Imagine a city of geniuses who've had decades to plan and build magical defenses against an invasion. My question is: why do you think the attackers have a sliver of a chance?
Well static defenses are really only good to provide a speedbump to enemies. Unless there is a relieving force coming or some kind of shot clock holding the attacking army together they can wait out, sieges rarely go to the defender. The invaders have magic as well. And while the defenders had a lot of time to put up defenses, you can't plan for everything, while the attacker can scout you and tailor tricks to get around your defenses.