No that's what severance clauses are for. Anything not legal can't be enforced but the contract minus those sections stands. Similarly she was not forced to have the surgery in any way at all. She has to return the device that she agreed to return, the surgery was optional.
They sorta are though boss and this wasn't in California iirc.
Ed:
But it wasn’t to last. In 2013, NeuroVista, the company that made the device, essentially ran out of money. The trial participants were advised to have their implants removed. (The company itself no longer exists.)
The ai wasn't supported any longer and both external and internal devices were no longer useful. Whoever buys the company would be buying the ai and the rights to the device, at that point they could have restored the device if the electrodes weren't removed. It seems they're quite confident that wouldn't happen anytime soon and so opted to have the electrodes removed.