I don't think companies in #4 are safe, mostly because commercial real estate is expensive. Consulting firms will advise them to either not renew building leases or have a hybrid/RTO policy as one of the first cost cutting measures.
Commercial real estate is cratering in most cities. Companies are actually having much more success renegotiating leases. When you can do that, you can resize your footprint and make it reasonable based on usage.