Ezekiel 29:19 states the G-d will give Egypt to Nebuchadnezzar II.
Therefore this is what the Sovereign LORD says: I am going to give Egypt to Nebuchadnezzar king of Babylon, and he will carry off its wealth. He will loot and plunder the land as pay for his army.
How is this compatible with the fact that Amasis II the pharaoh of Egypt repelled an attempted Babylonian invasion in 570/569 BCE?
The following quote is from A Companion to Ancient Egypt by Allan B. Lloyd:
Babylonian king embarked on an invasion of Egypt, apparently accompanied by Apries, whom he perhaps sought to restore to the throne as a vassal king. Probably even before he was able to penetrate into the east of the Delta, he was repulsed by Amasis. Apries himself was killed in this engagement, an event which gave his adversary the opportunity of burying him with dignity in Sais as evidence of his desirer for reconciliation.