I have found some more places where it was prophesied that the covenant would be broken if Israel disobeyed.
1 Kings 9:6-7, after dedicating Solomon’s Temple, Yahweh appears to Solomon and tells him:
If you or your sons turn away from following Me and do not keep My commands—My statutes that I have set before you—and if you go and serve other gods and worship them, I will cut off Israel from the land I gave them, and I will reject the temple I have sanctified for My name. Israel will become an object of scorn and ridicule among all the peoples.
Moses prophesied that because of their failure to keep the covenant, God would “provoke” Israel with a people “who are not a people (Deuteronomy 32:21, ESV):
They have made me jealous with what is no god; they have provoked me to anger with their idols. So I will make them jealous with those who are no people; I will provoke them to anger with a foolish nation.
God covenanted with the house of Levi forever, but when they disobeyed (1 Samuel 2:30):
Although I said
your family and your ancestral house
would walk before Me forever,
the Lord now says, “No longer!”
I will honor those who honor Me,
but those who despise Me will be disgraced.
And further, He said their iniquity “will never be wiped out by either sacrifice or offering” (1 Samuel 3:14).
Samuel warned that if Israel continued to do what was evil, “both you and your king will be swept away” (1 Samuel 12:25).
Like Moses, Joshua warned that the covenant would not be able to be kept (Joshua 24:19-20,27, hcsb):
But Joshua told the people, “You will not be able to worship Yahweh, because He is a holy God. He is a jealous God;He will not remove your transgressions and sins. If you abandon the Lord and worship foreign gods, He will turn against you, harm you, and completely destroy you, after He has been good to you.”