This is a Frame Challenge
The size of your wall and a 50-year siege are unbelievable. Here's why:
The Wall
Assuming a perfect circle, your wall's length is 79.3 miles. The density of your defense, if evenly spread out, is but one every 42 feet. That sounds like a lot, but it really isn't, especially when most guards are doubled up (now it's every 84 feet) and you have gate and watch tower emplacements taking some of the troops. It gets even worse when you realize that, at best, only 50% of your troops can be employed at one time (at all other times they're sleeping, eating, maintaining equipment, training...). But for the sake of comparison, let's stick with the 1:42 ratio.
Let's compare this to the Xi'an City Wall in China. That wall is only 8.7 miles long. Now let's think about population:
Xian lies some 600 miles south-west of Beijing, indeed it is the furthest west of all the major cities in China. But it was the first capital of the unified China, and in the Han dynasty (206 BC to AD 220) it had around a million inhabitants, and vied with Rome for the being the biggest city in the world. Later in the Tang dynasty (AD 600 – 900) it became if anything even bigger. (Source)
For convenience, let's stick with one million people and use your ratio of 1:20 for the fighters. That's 50,000 fighters on a 8.7 mile wall for an average of one fighter every 0.92 feet. A real-world example suggests you're understaffed for that wall by about 4,565%.
As designed, a good distraction would trivially open up a large enough hole in the wall's defenses to let an entire army through by climbing the wall before the nature of the distraction was understood. And the invading army could be better prepared to march across all that farmland than the wall's defenders.
Worse, you can't increase the population because you're trying to keep the population self-sufficient. 5X the population means 5X the necessary resources, most notably farmland. The more you try to fix the problem, the worse the problem gets.
The Siege
Let's examine the longest known siege (as a single effort) in human history: the Siege of Candia. That siege was about 20 years long and was fought between two sea powers, so some supplies could get through (support from sympathetic nations). The two nations, the Ottomans and the Venetians, were quite evenly matched in the beginning. Please note that sympathetic support — that's the practical equivalent of a self-sustaining city.
One thing the Ottomans couldn't do to the Venetians was undermine their fortifications. Keep in mind, the siege was primarily naval (Venice being what it is). Even a 20 year siege is more than enough time to simply dig tunnels under the wall starting from a far enough distance away that the defenders wouldn't notice the effort and couldn't do anything about it. But that's not the only problem.
That Wiki page ends with an interesting note. The Venetians planned, prepared, but did not execute biological warfare. Simply, they created a goo from the spleens of plague victims and planed to, basically, fling the goo at the Ottomans. Such a plan would work wonders against your city. In other words, whatever solutions are presented to you here — I'm pretty sure I can come up with a reasonable way to circumvent them and end the siege much, much sooner. When George S. Patton first encountered the French Maginot Line, he said:
This is a first-class case of man's monument to stupidity!
But it's the version from the 1970 film Patton that we're most familiar with:
Fixed fortifications are monuments to the stupidity of man. If mountain ranges and oceans can be overcome, then anything built by man can be overcome.
50 Years of Self-Sustaining City...
Sympathetic supplies means that natural problems in one location are offset by bounty in another. You don't have that privilege. You're assuming that for 50 years you have no drought, no disease (of people, plants, or animals... I know that you're handwaving this), that your material resources (minerals, lumber, stone, etc.) don't run out, and that people critical to the operation of the defense don't grow old and die. It also assumes that at the end of 50 years you don't have a population that's closer to 500,000, which would strain the resources of the original city 50 years earlier (a lot). That might seem to solve your wall manpower problem, but your city wasn't designed to feed or supply that many.
Fifty years is a whomping long time. It's not just a lifetime, it's several generations.
Conclusion
It's certainly true that you can craft a 50 year siege, but methinks that asking how to do it is irrelevant because realistically it is unlikely at best, impossible at worst. Presented with any answer to your question, I'm confident I can present a reasonable counter-argument as to why the siege would not last 50 years. Therefore, you're not really asking for a practical solution but a reasonable rationalization.
And at that point the question becomes too story-based, because we're helping you tell your story rather than answer a subjective question. Huh, after writing all this, I probably should have voted to close the question and requested that you clarify the circumstances of the siege and turn it into a reality-check question. In other words, I suspect I should have expected you to tell us how you wanted the siege to go, and we'd tell you if it was consistent with the rules of your world.
500 sq. mile city
is almost as big as Guam! $\endgroup$