"And you shall screen the ark" (Exodus 40:3). Our Rabbis taught: its shade must come from the covering [sekhakh] and not from the walls. Rabbi Yoshiyah says: even from the walls. What is the reason of Rabbi Yoshiyah? As it is written, "And you shall screen the ark with the curtain" (Exodus 40:3). The curtain is a partition, as it is written, "and the curtain shall divide for you" (Exodus 26:33), and yet the Merciful One called it a covering [sekhakh]; this shows that we require a partition that itself functions as covering. And the Rabbis hold that this which the Merciful One said is that he should bend it over a little, so that it appears like a covering.
Covering the Ark and the Rule of the Sukkah Roof
Yalkut Shimoni on Torah 417:4
(שמות מ א-לח) וְסַכֹּתָ עַל הָאָרֹן, תָּנוּ רַבָּנָן, חַמָּתָהּ מֵחֲמַת סְכַךְ וְלֹא מֵחֲמַת דְּפָנוֹת. רַבִּי יֹאשִיָּה אוֹמֵר, אַף מֵחֲמַת דְּפָנוֹת. מַאי טַעְמָא דְּרַבִּי יֹאשִיָּה, דִּכְתִיב (מ, ג) וְסַכֹּתָ עַל הָאָרֹן אֶת הַפָּרֹכֶת, פָּרֹכֶת מְחִיצָה הִיא, דִּכְתִיב (שמות כו, לג) "וְהִבְדִּילָה הַפָּרֹכֶת לָכֶם", וְקָא קְרָיָיהּ רַחֲמָנָא סְכָךְ, אַלְמָא בָּעֵינָן מְחִיצָה בִּסְכָךְ. וְרַבָּנָן, הַאי דְּקָאֲמַר רַחֲמָנָא דְּלֵיכוּף בָּהּ פּוּרְתָא, כִּי הֵיכֵי דְּתֵיחֲזֵי כִּסְכָךְ.