Tanya 26 teaches that spiritual struggle should be met with a broken heart and then with settled joy, not with despair. The passage can support a two-stage Shemini Atzeret posture: allow the wound to be felt honestly, then let joy become an act of faithful endurance rather than emotional amnesia.
וּמַה שֶּׁכָּתוּב: ״בְּכָל עֶצֶב יִהְיֶה מוֹתָר״, פֵּירוּשׁ, שֶׁיִּהְיֶה אֵיזֶה יִתְרוֹן וּמַעֲלָה מִזֶּה, הִנֵּה אַדְּרַבָּה, מִלָּשׁוֹן זֶה מַשְׁמַע, שֶׁהָעֶצֶב מִצַּד עַצְמוֹ אֵין בּוֹ מַעֲלָה, רַק, שֶׁיַּגִּיעַ וְיָבֹא מִמֶּנּוּ אֵיזֶה יִתְרוֹן, וְהַיְינוּ – הַשִּׂמְחָה הָאֲמִיתִּית בַּה׳ אֱלֹהָיו, הַבָּאָה אַחַר הָעֶצֶב הָאֲמִיתִּי לְעִתִּים מְזוּמָּנִים עַל עֲוֹנוֹתָיו בְּמַר נַפְשׁוֹ וְלֵב נִשְׁבָּר, שֶׁעַל יְדֵי זֶה, נִשְׁבְּרָה רוּחַ הַטּוּמְאָה וְסִטְרָא אָחֳרָא וּמְחִיצָה שֶׁל בַּרְזֶל הַמַּפְסֶקֶת בֵּינוֹ לְאָבִיו שֶׁבַּשָּׁמַיִם, כְּמוֹ שֶׁכָּתוּב בַּזֹּהַר עַל פָּסוּק: ״רוּחַ נִשְׁבָּרָה, לֵב נִשְׁבָּר וְגוֹ׳״, וַאֲזַי יְקוּיַּם בּוֹ רֵישֵׁיהּ דִּקְרָא: ״תַּשְׁמִיעֵנִי שָׂשׂוֹן וְשִׂמְחָה וְגוֹ׳, הָשִׁיבָה לִי שְׂשׂוֹן יִשְׁעֶךָ, וְרוּחַ נְדִיבָה וְגוֹ׳״. וְזֶהוּ טַעַם הַפָּשׁוּט לְתִיקּוּן הָאֲרִ״י זִכְרוֹנוֹ לִבְרָכָה, לוֹמַר מִזְמוֹר זֶה אַחַר תִּיקּוּן חֲצוֹת קוֹדֶם הַלִּימּוּד – כְּדֵי לִלְמוֹד בְּשִׂמְחָה אֲמִיתִּית בַּה׳ הַבָּאָה אַחַר הָעֶצֶב; שֶׁיֵּשׁ לְשִׂמְחָה זוֹ יִתְרוֹן, כְּיִתְרוֹן הָאוֹר הַבָּא מִן הַחֹשֶׁךְ דַּוְקָא, כְּמוֹ שֶׁכָּתוּב בַּזֹּהַר עַל פָּסוּק: ״וְרָאִיתִי שֶׁיֵּשׁ יִתְרוֹן לַחָכְמָה מִן הַסִּכְלוּת כִּיתְרוֹן הָאוֹר כוּ׳״, עַיֵּין שָׁם, וְדַי לַמֵּבִין. וְהִנֵּה, בֵּין שֶׁנָּפְלָה לוֹ הָעַצְבוּת בִּשְׁעַת עֲבוֹדָה בְּתַלְמוּד תּוֹרָה אוֹ בִּתְפִלָּה, וּבֵין שֶׁנָּפְלָה לוֹ שֶׁלֹּא בִּשְׁעַת עֲבוֹדָה, זֹאת יָשִׂים אֶל לִבּוֹ: כִּי אֵין הַזְּמַן גְּרָמָא כָּעֵת לְעַצְבוּת אֲמִיתִּית, אֲפִילוּ לְדַאֲגַת עֲוֹנוֹת חֲמוּרִים חַס וְשָׁלוֹם, רַק לָזֹאת צָרִיךְ קְבִיעוּת עִתִּים וּשְׁעַת הַכּוֹשֶׁר בְּיִשּׁוּב הַדַּעַת, לְהִתְבּוֹנֵן בִּגְדוּלַּת ה׳ אֲשֶׁר חָטָא לוֹ, כְּדֵי שֶׁעַל יְדֵי זֶה יִהְיֶה לִבּוֹ נִשְׁבָּר בֶּאֱמֶת בִּמְרִירוּת אֲמִיתִּית.
As for what is written, “In every sadness there is profit,” which means that some profit and advantage would be derived from it, the phrase, on the contrary, indicates that sadness in itself has no virtue, except that some profit is derived and experienced from it, namely, the true joy in the L–rd G–d which follows from genuine anguish over one’s sins at propitious moments with bitterness of soul and a broken heart. For thereby the spirit of impurity and of the sitra achara is broken, as also the iron wall that separates him from his Father in Heaven, as is commented in the Zohar on the verse, “A broken and a contrite heart, G–d, You will not disdain”; then will be fulfilled in him the preceding verses: “Let me hear joy and gladness…. Restore to me the joy of Your deliverance, and uphold me with a spirit of magnanimity.” This is the simple reason why the Arizal instituted the recital of this Psalm after the Midnight Prayer, before commencing study, in order to study with the true joy in G–d which succeeds remorse. For such joy has an excellence similar to that of a light emerging from the very darkness, as is written in the Zohar on the verse, “And I saw that wisdom surpasses folly, as the light surpasses darkness.” Note there, and it will suffice for him who understands. Thus, whether the melancholy encroaches on him during Divine service, in study or prayer, or not during Divine service, he should tell himself that now is not the time for genuine anxiety, not even for worry over serious transgressions, G–d forbid. For, for this, one needs appointed times and a propitious occasion, with calmness of mind to reflect on the greatness of G–d, against Whom one has sinned, so that thereby one’s heart may truly be rent with sincere contrition.