An Australian city did that. Australia is not MelbourneThere are very few places on the planet where there is even the tiniest chance that works. You have to start holing up before there's significant community spread, and most places can't actually lock down international travel, and most places have animal populations that act as carriers for sars-cov-ii. If you are lucky enough that the problem can just go away in a few weeks, that's luck of the draw, you haven't conquered pandemics, I promise.
But also, the problem didn't actually go away, it just took slightly longer to get there, you still all got exposed to covid just like the rest of the world did. Once it was spreading significantly, Australian cities attempted months long lockdowns like the rest of the world had tried, and it failed exactly the same, and then they just let it run its course in 2022.
Over the two years, my city was locked down for 7 weeks. Most major cities were like that
But you are right. A proper lockdown required a government who was willing to do the right thing and a population who was willing to put up with short term pain for long term results
America is not that country.