Jeremiah 18
7 If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, 8 and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. 9 And if at another time I announce that a nation or kingdom is to be built up and planted, 10 and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it.

Why is God saying this? Is it to show those who disobey, that they could have been blessed were it not for their wickedness?

This neither renders God limited in knowledge nor incapable of changing a sinner's heart, IMO.