You become stateless, and it’s a legal nightmare. Most countries won’t deport you, because they have nowhere to deport you to. But some countries like Australia will detain you until you get citizenship elsewhere. Sort of a catch-22, where you need to apply for citizenship to get out of prison, but can’t because no country wants to grant you citizenship because you’re in prison. The act of being stateless in itself isn’t a crime, but living somewhere without a visa is, and some countries (like Australia) don’t automatically grant visas to stateless people without some other reason like a refugee application.
Prior to the 60’s, it used to be much more common, because most countries use a legal concept called Jus Sanguinis, which basically means that citizenship gets passed from parents to children via birth. America, on the other hand, uses something called Jus Soli, which grants citizenship based on you being born in the country. But if the parents aren’t eligible to pass their citizenship on and the country they’re in doesn’t practice Jus Soli, then the child would be stateless. Back in the 60’s, most Jus Sanguinis countries agreed at a convention to provide emergency citizenship to individuals who would otherwise be born stateless.
These days, the largest causes are typically financial/records keeping issues in third world countries, or are due to politics like you’re describing. In the former, imagine a Jus Sanguinis country where you need to prove who your parents are. But they don’t have copies of their birth certificates or your birth certificate, and you don’t have money to get new ones. There’s also an administrative fee when you try to file the paperwork, and you can’t afford it. In the latter, it’s often due to good old fashioned racism. Certain ethnic groups being denied citizenship (like the Uyghur Muslims in China, or the Koreans in Japan following world war 2.) It’s also commonly due to authoritarian governments stripping citizenship for arbitrary reasons like you’ve mentioned. Russia isn’t the first to strip citizenship; It’s also common in parts of the Middle East.
Also, not everyone had the option of staying in. That was a benefit reserved for the privileged few. At least in America, the lack of government support meant that lots of people had to choose between starving to death or potentially catching a (probably non-lethal) disease. Hell, there weren’t even regulations passed regarding the right to work from home, so it was entirely at the employer’s discretion if you got to stay home.
My employer mandated that every worker was essential, and had everyone continue coming into work. On the one hand, it was nice having a solid 40 hours straight through the pandemic. I never had to deal with the unemployment BS. On the other, it meant I was constantly seeing my office mates and couldn’t properly isolate. Hell, the same job one city over let everyone go home for two full years and paid them a fucking full salary the entire time. That could have been my job too, but due to differing leadership I had to continue going to work every single day.