I thought that there was a prophet who was particularly opposed to allying with Egypt. Egypt subsequently fell and his position became validated. The Judeans lasted a little longer and then came under control of Assyria or Babylon.
Looking at this now, I can't quite find what I was thinking about. I'm not seeing the overt biblical overture against Egypt that I thought there was immediately prior to Egypt falling. It seems like it would have been during Hezekiah or Josiah.
Hezekiah seems to have allied with the Egyptians, and possibly have been saved by this. During Josiah, I don't see the firm edicts that outlining such a position, or the extent of opposition beyond Megiddo.