Bureaucratic nonsense seems to be the most fitting scenario here, plus it seems to fit with the humorous nature of the concept.
You might find some inspiration in the story of the The Yellow Fleet interesting, a group of ships trapped in the Suez Canal for 8 years because of the Six Day War which formed their own community while waiting it out. (+ this 99 Percent Invisible podcast episode about it)
In another episode of that podcast, they discussed houses in Washington DC which are technically owned by foreign governments and thus not subject to the local laws. Diplomatic houses may wind up abandoned and fall into disrepair, but because of diplomatic relations and bureaucracy there's not much anyone can or will do about them.
Another interesting story this reminds me of is how the British government only recently finally paid off some debts that were hundreds of years old. Despite these debts being so old that the government had undergone massive changes since then, and generations of people have come and gone, the financial system remained intact and the debt continued to get paid.
There are also many instances of strange geographic quirks that came about as a result of diplomatic disputes / relations. Such as Vennbahn on the Germany / Belgium border, or Point Roberts, Washington. 454
Once a country has possession of some territory, there isn't necessarily any reason for them to give it up, despite inconveniences it may cause to locals (e.g. students in Point Roberts cross four borders each day to get to high school and back).
Would need to think more about the bureaucratic situation that could lead to this particular scenario, but presumably would have to have something to do with a government having no real incentive to end the siege and a bureaucratic system that doesn't really have the capacity to do anything about it. Plus the more convoluted the reasoning is, the better. Perhaps a character might not even want to bother explaining it because it's so complicated. Some characters might pride themselves on explaining it properly. Maybe there's a lack of clarity about the reasoning leading to multiple seemingly plausible versions that formed from rumors that generate local arguments and urban legends.
Note, presumably there would have to be something inconvenient about the arrangement as well — if it didn't cause any problems in the lives of the locals, and it was just an amusing historical anecdote, it wouldn't be a particularly interesting or relevant to the characters in the present day. 454