What I said was extremely simple, there are a million ways it could turn into law. A simplistic solution in my mind would be a rule that if your example were to happen, the patent is transferable in the case that the purchasing company intended to act on that patent (insert legal shenanigans to define what that means here).
The general intention is that a company can not own a patent which it does not have a vested interest in acting on, how that is defined could be an entire thread of its own.
So, making patents not transferable only adds a step or two depending on how complex the law is.