Moses foretold the dispersion of Israel among the nations because of their idolatry AND the return of Israel in the latter days!
Deuteronomy 4:30The Lexham English Bible
In your distress when all these things have found you in the latter days, then you will return to Yahweh your God, and you will listen to his voice.