Once foreclosures start happening and building owners default, the debt holders end up taking ownership of property that just isn't worth as much has housing real estate anymore. It then becomes a problem for them because empty offices still cost money. They can sell the building at a steep discount or do something else with it.
It's the the price difference between office and housing prices that might make it economical to convert buildings. The issue with that of course is that housing real estate prices are also under pressure as people are no longer as eager to live close to their now empty office buildings. So, it's still a risky investment and whoever ends up owning the building would need to finance that somehow. And there are those pesky zoning rules that outright prevent this in a lot of places.
Those rules are no accident of course. Banks have an interest in keeping housing prices artificially high as well. If those prices come down, they have another debt bubble to worry about.
So first the buildings have to lose so much value that the math works.
It is possible in some though, this is an example from London - https://en.wikipedia.org/wiki/Centre_Point
I worked for one of the last companies out in ... I think it was 2014. Three years to refurb and now it's one of London's ghost towers - full of apartments bought by overseas investors, standing largely empty.
(Or in this case, from reports in about 2018, standing empty because it turns out that very few people actually want to pay 1.8 million pounds for a one bedroom flat, even in London. It's quite fitting as apparently the block spent nearly a decade empty after construction too.)
https://www.foxnews.com/us/trendy-boston-waterfront-district...