Goodness no. The "Moses not asking directions" is a famous joke, but just a joke.
The 40 years in the desert were a punishment decreed early-on; once the years were up, G-d said "okay, time to start entering the land." The people in that year didn't need to cry out. And they were never "lost." During those 40 years, they were ordered/directed where to go in the desert -- it just wasn't the way they wished to go.
Psalm 107 does describe people who should give thanks after dangerous ordeals. Leviticus 7:12 describes a "thanks" offering (korban todah). Today instead we recite Birkat HaGomel publicly in synagogue. The linkage between Psalm 107 and the requirement to publicly give thanks appears in the Talmud, Berachot 54b (I'm just pasting Sefaria's translation here):
אָמַר רַב יְהוּדָה אָמַר רַב: אַרְבָּעָה צְרִיכִין לְהוֹדוֹת: יוֹרְדֵי
הַיָּם, הוֹלְכֵי מִדְבָּרוֹת, וּמִי שֶׁהָיָה חוֹלֶה וְנִתְרַפֵּא,
וּמִי שֶׁהָיָה חָבוּשׁ בְּבֵית הָאֲסוּרִים וְיָצָא. Rav Yehuda said
that Rav said: Four must offer thanks to God with a thanks-offering
and a special blessing. They are: Seafarers, those who walk in the
desert, and one who was ill and recovered, and one who was
incarcerated in prison and went out. All of these appear in the verses
of a psalm (Psalms 107).
The Talmud continues...
הוֹלְכֵי מִדְבָּרוֹת מְנָלַן? דִּכְתִיב: ״תָּעוּ בַמִּדְבָּר
בִּישִׁימוֹן דָּרֶךְ עִיר מוֹשָׁב לֹא מָצָאוּ … וַיִּצְעֲקוּ אֶל ה׳ …
וַיַּדְרִיכֵם בְּדֶרֶךְ יְשָׁרָה … יוֹדוּ לַה׳ חַסְדּוֹ״. The Gemara
asks: From where do we derive that those who walk in the desert are
required to thank God? The Gemara answers: As it is written in the
same psalm: “They wandered in the wilderness in a solitary way; they
found no city in which to dwell” (Psalms 107:4), “And then they cried
unto the Lord in their trouble, and He delivered them out of their
distresses. And He led them forth by the right way” (Psalms 107:6–7).
After God guides them on the right way, it is said: “They are grateful
to God for His goodness” (Psalms 107:8).
If you look in the context of Psalm 107, it is (as the Talmud notes) describing four categories of people going through a dangerous ordeal. Seafarers, the seriously ill, those traveling in the wilderness, and those imprisoned. The Jews of the desert were clearly not seafarers, so it would be very odd for one-quarter of this Psalm to be a historical reference to one particular group of desert-goers, when the other thirds are about people in general.
Malbim's commentary does put these verses into context. Chapter 106 ends with a prayer that the Jews be "gathered from the nations", back to Israel. Chapter 107 therefore continues: upon returning from exile from north, south, east, and west, they will thank G-d. Now additionally, those who go through the wilderness, or illness, etc. will thank G-d. (Alternatively: upon the ingathering of the Jews, they will thank G-d for all the dangerous occasions they survived.)