Could be a few things but they all revolve around taxes.
For one thing not tax related, if the tenant is a big corporation, sometimes they’ll shutter a losing location but that doesn’t mean their lease isn’t still enforceable. They may pay rent on a vacant space for years. If the owner can rent to others and wants to do that to keep up the property to keep it attractive for other tenants they may do that, but that means a bunch of money dumped into up fitting for new tenants and cessation of the existing lease for the prior tenant. That assumes the prior tenant is agreeable to a mutual cessation of the standing lease, but they usually are if they’ve already departed.
From the standpoint of the owner, if the building has been mostly vacant and has fallen into disrepair, it can be more cost effective to sell the property to a new owner, which could be another LLC set up by the same principals that set up the LLC that owned the property during its vacancy. Selling allows recoupment of all amortized unrealized depreciation in the tax year of sale. That can free up cash to upfit for new tenants in a new building to start the depreciation thing all over again. It also is much easier to get financing for tenant upfits in a new building v an old building in poor condition.
I suspect if you could peel back the layers you’d likely find the property changed hands shortly before the new building started. You’d have to peel back more layers to see if that’s really a new owner or if it’s a “new owner” that’s a corporation that’s really just a new company owned by the same people. Even if it’s truly a new owner, likely they were swapping properties with the old owner for depreciation recoupment to put a little steroid shot in both their bank accounts. Property swapping for tax purposes is common in that business.
It’s all about timing and taxes. And yes, my family had a side business of owning Class B office space and a few strip malls back in the day before some of the principals became so elderly they needed to move on and the population numbers of the next generation past mine, through some unfortunate events and untimely deaths, became too imbalanced to make continuation to the next generation viable.
Our accountants and lawyers understood this crap better than me, but the above is still a valid high level view of some of the likely drivers of behavior that appears non-sensical to normal people driving by observing the apparent madness.