Deuteronomy 9 does read as though Moses is speaking extemporaneously. He roams around over future and past events, and actually gets some details wrong. But there is a main point. Yahweh didn't choose the Israelites because they are deserving. In fact they aren't, and he nearly wiped them out and chose some other people on more than one occasion. For unspecified reasons the people he's going to have the Israelites massacre are even worse, however. Anyway, being the chosen people isn't an honor. In fact it's a burden, although it can pay off if you're abjectly subservient and unquestionably and unfailingly obedient. I'm not sure that's a bargain I'd want to make.
9 “Hear, O Israel; you are to pass over the Jordan this day, to go in to dispossess nations greater and mightier than yourselves, cities great and fortified up to heaven, 2 a people great and tall, the sons of the Anakim, whom you know, and of whom you have heard it said, ‘Who can stand before the sons of Anak?’ 3 Know therefore this day that he who goes over before you as a devouring fire is the Lord your God; he will destroy them and subdue them before you; so you shall drive them out, and make them perish quickly, as the Lord has promised you.
Here we are with the giants again. God has already dealt with Og but apparently there are still more on the other side of the river. Remember that these are descendants of mysterious beings called the "Sons of God" who impregnated human women in Genesis, and who somehow survived the flood. Don't ask, because true believers never do.
4 “Do not say in your heart, after the Lord your God has thrust them out before you, ‘It is because of my righteousness that the Lord has brought me in to possess this land’; whereas it is because of the wickedness of these nations that the Lord is driving them out before you. 5 Not because of your righteousness or the uprightness of your heart are you going in to possess their land; but because of the wickedness of these nations the Lord your God is driving them out from before you, and that he may confirm the word which the Lord swore to your fathers, to Abraham, to Isaac, and to Jacob.
6 “Know therefore, that the Lord your God is not giving you this good land to possess because of your righteousness; for you are a stubborn people. 7 Remember and do not forget how you provoked the Lord your God to wrath in the wilderness; from the day you came out of the land of Egypt, until you came to this place, you have been rebellious against the Lord. 8 Even at Horeb you provoked the Lord to wrath, and the Lord was so angry with you that he was ready to destroy you. 9 When I went up the mountain to receive the tables of stone, the tables of the covenant which the Lord made with you, I remained on the mountain forty days and forty nights; I neither ate bread nor drank water. 10
Human can survive no more than 3 or 4 days without water, and a little more than week without food. But believers will no doubt simply ascribe this to a miracle.
And the Lord gave me the two tables of stone written with the finger of God; and on them were all the words which the Lord had spoken with you on the mountain out of the midst of the fire on the day of the assembly. 11 And at the end of forty days and forty nights the Lord gave me the two tables of stone, the tables of the covenant. 12 Then the Lord said to me, ‘Arise, go down quickly from here; for your people whom you have brought from Egypt have acted corruptly; they have turned aside quickly out of the way which I commanded them; they have made themselves a molten image.’
13 “Furthermore the Lord said to me, ‘I have seen this people, and behold, it is a stubborn people; 14 let me alone, that I may destroy them and blot out their name from under heaven; and I will make of you a nation mightier and greater than they.’ 15 So I turned and came down from the mountain, and the mountain was burning with fire; and the two tables of the covenant were in my two hands. 16 And I looked, and behold, you had sinned against the Lord your God; you had made yourselves a molten calf; you had turned aside quickly from the way which the Lord had commanded you. 17 So I took hold of the two tables, and cast them out of my two hands, and broke them before your eyes. 18 Then I lay prostrate before the Lord as before, forty days and forty nights; I neither ate bread nor drank water, because of all the sin which you had committed, in doing what was evil in the sight of the Lord, to provoke him to anger. 19 For I was afraid of the anger and hot displeasure which the Lord bore against you, so that he was ready to destroy you. But the Lord hearkened to me that time also. 20 And the Lord was so angry with Aaron that he was ready to destroy him; and I prayed for Aaron also at the same time. 21 Then I took the sinful thing, the calf which you had made, and burned it with fire and crushed it, grinding it very small, until it was as fine as dust; and I threw the dust of it into the brook that descended out of the mountain.
Actually no, that's not what he did. In Exodus 32, he made the people drink a soup of the burned, crushed golden calf. Of course gold doesn't burn, so it makes no sense either way. But in any case this is a direct contradiction.
22 “At Tab′erah also, and at Massah, and at Kib′roth-hatta′avah, you provoked the Lord to wrath. 23 And when the Lord sent you from Ka′desh-bar′nea, saying, ‘Go up and take possession of the land which I have given you,’ then you rebelled against the commandment of the Lord your God, and did not believe him or obey his voice. 24 You have been rebellious against the Lord from the day that I knew you.
25 “So I lay prostrate before the Lord for these forty days and forty nights, because the Lord had said he would destroy you. 26 And I prayed to the Lord, ‘O Lord God, destroy not thy people and thy heritage, whom thou hast redeemed through thy greatness, whom thou hast brought out of Egypt with a mighty hand. 27 Remember thy servants, Abraham, Isaac, and Jacob; do not regard the stubbornness of this people, or their wickedness, or their sin, 28 lest the land from which thou didst bring us say, “Because the Lord was not able to bring them into the land which he promised them, and because he hated them, he has brought them out to slay them in the wilderness.” 29 For they are thy people and thy heritage, whom thou didst bring out by thy great power and by thy outstretched arm.’