Not to defend Elon Musk since I generally agree that this whole thing is a dumpster fire of his own making but he couldn't have backed out by paying the contract breaking fee. Twitter was suing him for specific performance, meaning they were asking the courts to force him to close the deal. And everything I read during the saga seemed to be in agreement that Musk had ~0% chance of getting out of the deal.