I don't think that is legally feasible but I don't have enough experience in this. He sold the company, aka shares. The contract should determine how the sale happen but afterward, it's afterward.
A contract needs to be legal, and legal means what the law allows in the context. Does the law allow putting such provisions? I've been burnt by this in a rental agreement. Think about it this way: if we have a contract between both of us, where you agree that I'm going to kill you, I'm still going to jail. Having a contract doesn't make killing legal. This also applies to the rest of contracts. The provisions need to respect the law.
But the guy didn't have a contract, sold a patent-heavy company for $3bn (probably an army of lawyers involved) that netted him around $700mn. I'd just call this saving face.