For modern buildings, it's probably cheaper to tear it down and rebuild. For buildings built before WWII, it sometimes pencils out.
There was a recent discussion on HN about this https://www.nytimes.com/interactive/2023/03/11/upshot/office... ,
but yes. Basically older buildings can work (though the conversions are still expensive and tend to assume luxury apartments) but it's a lot harder with newer skyscrapers.
I heard someone describe it as a plumbing issue in terms of turds-per-hour.
Normally, your CRE is plumbed for 10 TPH. If you convert it into residences, then you're looking at 1000 TPH.