If you're running "Loot Boxes Unlimited" and your business is taking off like a rocket and you invest $300 million in a new HQ, and then just as your finishing up, congress passes a law making loot boxes illegal and you're no longer going to be able to afford moving into that new HQ, you get to write off those expenses just the same. You must offset them by any gains you get from any part of it you do sell off, but you're under no obligation to sell the building, you can just keep it on the books depreciating slowly. Most companies will try to sell what they can to recoup some of those losses, because recouping any of the loss tends to be a better financial option than the write off for that same amount. But selling a building doesn't have the same legal and contractual entanglements that selling a movie might have.
Additionally a building is still useful even if you can't use it for what it was originally intended for. But who is going to buy a movie they can't release? You'd need some company with enough money to buy a produced movie (even if at a discount) who also thinks they could release it and make enough money on it to cover their costs AND who will also be willing to take on all the contractual obligations like licensing and residuals. And chances are in addition to all of that, they also have to be willing to license the various properties that the movie studio already owns (or worse, re-negotiate the rights from the original holders that the studio had already previously negotiated).
It's also important to remember that those expenses would have been written off whether or not the movie was released. My understanding here is the only difference between releasing and not releasing the movie is whether that write off occurs over 3-5 years, or all in this year