Shemot13:17

וַיְהִי בְּשַׁלַּח פַּרְעֹה אֶת־הָעָם וְלֹא־נָחָם אֱלֹהִים דֶּרֶךְ אֶרֶץ פְּלִשְׁתִּים כִּי קָרוֹב הוּא כִּי אָמַר אֱלֹהִים פֶּן־יִנָּחֵם הָעָם בִּרְאֹתָם מִלְחָמָה וְשָׁבוּ מִצְרָיְמָה׃

And it came to pass, when Pharaoh let the people go, that the Almighty did not lead them by the way of the land of the Plishtim (Philistines), although it was near, for the Almighty said: "Lest the people change their minds when they see war, and return to Egypt."

Shemot 13:17

וַיְהִי בְּשַׁלַּח פַּרְעֹה

Shemot / Exodus 13:17 · Remez

Shemot 13:17

וַיְהִי בְּשַׁלַּח פַּרְעֹה אֶת־הָעָם וְלֹא־נָחָם אֱלֹהִים דֶּרֶךְ אֶרֶץ פְּלִשְׁתִּים כִּי קָרוֹב הוּא כִּי אָמַר אֱלֹהִים פֶּן־יִנָּחֵם הָעָם בִּרְאֹתָם מִלְחָמָה וְשָׁבוּ מִצְרָיְמָה׃

And it came to pass, when Pharaoh let the people go, that the Almighty did not lead them by the way of the land of the Plishtim (Philistines), although it was near, for the Almighty said: "Lest the people change their minds when they see war, and return to Egypt."

Remez רֶמֶז

"And it came to pass": "woe was"

Sometimes a future trouble is already hidden in a day of joy: you take someone along on the road who will later spoil everything. The festival of leaving Egypt also begins with an anxious word.

Agra DeKala: the Talmud reads the word "and it came to pass" as "woe was". Woe came because Pharaoh let a mixed multitude go along with Israel: without them there would have been no golden calf and many troubles. Or woe came because the accusation against Israel still stood, and the redemption was completed only at the sea.

How Agra DeKala explain it

Agra DeKala And it came to pass, when Pharaoh let the people go (Shemot / Exodus 13:17)

Wherever it says "and it came to pass" (וַיְהִי), it is trouble for the enemies of Israel, from the words "woe was" (וַי הִי) (Megillah 10b). And we need to understand what it means here.

One can say: "woe was" because Pharaoh let "the people" go, that is, the mixed multitude (עֵרֶב רַב). Had he not let the mixed multitude go along with Israel, they would not have come to all of this: to the sin of the golden calf, to all the sins and all the troubles, and so until the time of the end, when the Eternal will burn the spirit of impurity out of the land.

Or one can say: "woe was" when Pharaoh let the people go, because the accusation still stood: "these serve idols, and those too" (Yalkut Shimoni, 234). And the end was not yet complete until the splitting of the Sea of Reeds, as it says: "And the Eternal saved on that day" (Shemot / Exodus 14:30), on that very day, as is known.

Takeaway

The Talmud: wherever it says "and it came to pass" (וַיְהִי), it speaks of trouble, because the word can be read as "woe was" (וַי הִי) (Megillah 10b).
The mixed multitude (עֵרֶב רַב) are people of other nations who went out of Egypt together with Israel (Shemot / Exodus 12:38). Rashi writes that it was they who gathered around Aharon (Aaron) and made the golden calf (Rashi on Shemot / Exodus 32:4).
Yalkut Shimoni is a medieval collection of midrashim on the whole Tanakh. Agra DeKala refers to its section 234.
"On that very day": for Agra DeKala the full redemption came not on the day of leaving, but on the day the sea split.