No, but the OP is specifically about this unrealistic scenario about an actual, true lockdown where literally everybody stays at home.
But if we don’t fight that hypothetical, then, yes, it’s one way to fight the virus. Not an especially realistic or desirable way and one with an absolutely enormous body count (as admitted by the OP itself) but certainly one way to do it.
Legit question: why would that matter? It’s a pretty cold-hearted OP, as it says people would have to stay put even if dying, but if all those people in congregate settings stayed inside that setting and didn’t leave, only those people in the congregate setting would be at risk for getting sick. They would not spread it outside that setting. This is a horrible, nightmarish scenario, and I’m certainly not endorsing it, just trying to understand.
It matters because of time. If everyone lived in a single-family household of no more than, say, four or five people, you might be looking at a four-week lockdown before everyone who is going to be infected is no longer contagious. If the virus has to work its way through a prison with several thousand prisoners, it might take months.
Wuhan was locked-down for seventy days or so. You might recall that it’s not all that long since the PRC modified the one-child policy to a two-child policy, so it’s probably a fair bet to say that there weren’t that many four- or five-person households within the city.