Ezekiel 29

Ezekiel 29:12

"And I will cause her land to be utterly destroyed in the midst of a land that is desolate, and her cities shall be [desolate] forty years in the midst of cities that are desolate: and I will disperse Egypt among the nations, and will utterly scatter them into the countries."
Did the prophecy of Egypt's desolation fail?

Regarding the prophecy of Ezekiel 29:11-12 that Nebuchadnezzar would conquer Egypt and leave it desolate for 40 years:

Our sources for this period are very sparse. Extant records do indicate that Nebuchadnezzar did indeed conquer Egypt, but whether he took them into captivity and left Egypt desolate for 40 years is neither proven nor disproven by our historical sources.

However, it was Nebuchadnezzar's policy to deport peoples from conquered lands (as he did with Judah), and there is a 33-year gap between the time that Nebuchadnezzar attacked Egypt and the time that Cyrus defeated Babylon. Allowing either for rounded numbers or time to return to Egypt, we have a possible span into which we could see those 40 years. Therefore, for lack of evidence, this prophecy cannot be judged a priori a failure.

Furthermore, except where a promise is confirmed by God's oath, every statement of God about the future has some element of the conditional in it. As Jeremiah 18:7-10 states, a change of behavior (such as repentance) can annul a prophecy of destruction.