At the middle of chapter 9 in our parsha the Torah recounts the cheit ha'eigel, Hashem's anger, and Moshe's tefilah to avert terrible punishment threatened by G-d (9:18):
וָֽאֶתְנַפַּל֩ לִפְנֵ֨י ה׳ כָּרִאשֹׁנָ֗ה אַרְבָּעִ֥ים יוֹם֙ וְאַרְבָּעִ֣ים לַ֔יְלָה לֶ֚חֶם לֹ֣א אָכַ֔לְתִּי וּמַ֖יִם לֹ֣א שָׁתִ֑יתִי עַ֤ל כׇּל־חַטַּאתְכֶם֙ אֲשֶׁ֣ר חֲטָאתֶ֔ם לַעֲשׂ֥וֹת הָרַ֛ע בְּעֵינֵ֥י ה׳ לְהַכְעִיסֽוֹ׃
The perek then continues with the various stops in the desert where Bnei Yisrael were rebellious:
וּבְתַבְעֵרָה֙ וּבְמַסָּ֔ה וּבְקִבְרֹ֖ת הַֽתַּאֲוָ֑ה מַקְצִפִ֥ים הֱיִיתֶ֖ם אֶת ה׳
וּבִשְׁלֹ֨חַ ה׳ אֶתְכֶ֗ם מִקָּדֵ֤שׁ בַּרְנֵ֙עַ֙ לֵאמֹ֔ר עֲלוּ֙ וּרְשׁ֣וּ אֶת־הָאָ֔רֶץ אֲשֶׁ֥ר נָתַ֖תִּי לָכֶ֑ם וַתַּמְר֗וּ אֶת־פִּ֤י ה׳ אלקיכם וְלֹ֤א הֶֽאֱמַנְתֶּם֙ ל֔וֹ וְלֹ֥א שְׁמַעְתֶּ֖ם בְּקֹלֽוֹ׃
But then, strangely, the Torah comes back yet again to Moshe's tefilah at Sinai in response to the eigel:
וָֽאֶתְנַפַּ֞ל לִפְנֵ֣י יְהֹוָ֗ה אֵ֣ת אַרְבָּעִ֥ים הַיּ֛וֹם וְאֶת־אַרְבָּעִ֥ים הַלַּ֖יְלָה אֲשֶׁ֣ר הִתְנַפָּ֑לְתִּי כִּֽי־אָמַ֥ר ה׳ לְהַשְׁמִ֥יד אֶתְכֶֽם
וָאֶתְפַּלֵּ֣ל אֶל ה׳ וָאֹמַר֒ ה׳ אלקים אַל־תַּשְׁחֵ֤ת עַמְּךָ֙ וְנַחֲלָ֣תְךָ֔ אֲשֶׁ֥ר פָּדִ֖יתָ בְּגׇדְלֶ֑ךָ אֲשֶׁר־הוֹצֵ֥אתָ מִמִּצְרַ֖יִם בְּיָ֥ד חֲזָקָֽה
זְכֹר֙ לַעֲבָדֶ֔יךָ לְאַבְרָהָ֥ם לְיִצְחָ֖ק וּֽלְיַעֲקֹ֑ב אַל־תֵּ֗פֶן אֶל־קְשִׁי֙ הָעָ֣ם הַזֶּ֔ה וְאֶל־רִשְׁע֖וֹ וְאֶל־חַטָּאתֽוֹ
פֶּן־יֹאמְר֗וּ הָאָ֘רֶץ֮ אֲשֶׁ֣ר הוֹצֵאתָ֣נוּ מִשָּׁם֒ מִבְּלִי֙ יְכֹ֣לֶת ה׳ לַהֲבִיאָ֕ם אֶל־הָאָ֖רֶץ אֲשֶׁר־דִּבֶּ֣ר לָהֶ֑ם וּמִשִּׂנְאָת֣וֹ אוֹתָ֔ם הוֹצִיאָ֖ם לַהֲמִתָ֥ם בַּמִּדְבָּֽר
Rashi comments on the spot that ואתנפל וגומ׳ – אילו הן עצמן האמורים למעלה (דברים ט׳:י״ח). וכפלן כאן לפי שכתוב כאן סדר תפלתו this is the same episode and same prayers referred to earlier, now repeated to fill in the words of Moshe's tefilah.
Two obvious questions that beg asking: Firstly, why did the Torah separate these two sections? Why not just tell us the words of Moshe's tefilah earlier when it was first mentioned? Secondly, why do we need to know the details of what Moshe said? Why wouldn't it be enough to say he davened and we were saved and leave it at that?
Don't miss seeing Rashbam who says חכמה גדולה יש כאן. This is a generation removed from those who actually experienced mattan Torah and did the sin of cheit ha'eigel. The first part of the perek is the story of what happened, a recounting of past events. The second half of the perek, after Moshe leapfrogs through telling them about the rebellions in the desert and gets to the point in history where they are about to enter the Land, is the take away message that he wants this generation to absorb. Sefer Devarim is a mussar talk to those about to enter Eretz Yisrael. What is the take away mussar here?
By filling in the words of his tefilah and the argument he used, Moshe was telling this generation that the lesson for them is NOT that when Klal Yisrael is in trouble, Moshe, or in future generations some other Navi/Chacham/Rebbe, will intercede on their behalf and get them out of the jam. Exactly the opposite. Moshe is telling then that when they were still in the desert, he could argue to G-d that to punish the people and not bring them into Eretz Yisrael is a chilul Hashem because the goyim will say that G-d just couldn't do it, מִבְּלִי֙ יְכֹ֣לֶת ה׳ לַהֲבִיאָ֕ם אֶל־הָאָ֖רֶץ אֲשֶׁר־דִּבֶּ֣ר לָהֶ֑ם. Once they in the Land, however, that argument doesn't hold water. Once in the Land, no one can have the misimpression that מִבְּלִי֙ יְכֹ֣לֶת ה׳ לַהֲבִיאָ֕ם אֶל־הָאָ֖רֶץ. So don't expect an encore performance in Eretz Yisrael of those same prayers that got you out of trouble in the past. Don't expect a Navi/Chacham/Rebbe to pull the fat out of the fire when you get yourselves in hot water. It's up to you to do good on your own.