That's exactly what China has been repeatedly criticized for doing in Shanghai and Bejing and elsewhere (and is still doing today).
Of course NZ stopped doing it after 5 months, after reviewing the data (I mean I hope they were reviewing data and evaluating the human costs).
From what I can tell the initial order (after a single case) was for 7 days in Aukland and 3 days for all surrounding cities. How long it actually lasted I'm not sure, but this merely is one example of an idea that was promoted globally.
You can pretend an entire city spending 7 days locked in their house, after a single COVID case in a city of 1.6 million, is not much to ask of people. But we might have different value systems.