I saw in the Midrash Tanchuma on Parshas Bamidbar the following:
(Source provided by Sefaria.org)
אָמַר לָהֶם הַקָּדוֹשׁ בָּרוּךְ הוּא, בָּעוֹלָם הַזֶּה, נִתְאַוֵּיתֶם לִדְגָלִים, וּמִלֵּאתִי מִשְׁאֲלוֹתֵיכֶם. וְלֶעָתִיד לָבֹא, בִּזְכוּת הַדְּגָלִים אֲנִי גּוֹאֵל אֶתְכֶם, וּמְדַלֵּג עַל הַקֵּץ בִּזְכוּת אָבוֹת שֶׁנִּקְרְאוּ הָרִים, שֶׁנֶּאֱמַר: קוֹל דּוֹדִי הִנֵּה זֶה בָּא, מְדַלֵּג עַל הֶהָרִים, מְקַפֵּץ עַל הַגְּבָעוֹת (שה״ש ב, ח
G-d said to them (the Children of Israel): In this world you desired for flags (for your tribes) and I fulfilled your request. In the future, because of the merit of those flags I will redeem you. As the verse states "Hark! My beloved! There he comes, Leaping (מדלג) over mountains, Bounding over hills." (Shir HaShirim 2:8)
Is there anything written about the reason for why the flag serves a merit for the children of Israel to be redeemed?
I saw in the footnotes of the Artscroll Chumash with Rashi 1 unlike other commentaries who understand the word דגל as "flag" Rashi sees it as a "division, disposition of forces, military formation"
While this is insightful it still does not answer the question of why the divisions/flags of Israel serve as a merit to be redeemed. But definitely something to take note of.
1 See Bamidbar pg. 9 footnote 3 for the entire context