This would be like suing Google for removing “Don’t be evil” from their mission statement.
I'm not saying that Musk has a good case. I haven't read the complaint.
Still, with a non-profit, you're donating to a certain cause. If I create "Save the Climate" as a non-profit and then pivot to creating educational videos on the necessity of fossil fuels, I think it'd be reasonable to sue since we aren't performing our mission. There's certainly some latitude that management and the board should enjoy in pivoting the mission, but it isn't completely free to do whatever it wants.
Even with a for-profit company, if management or the board pivot in a way that investors think would be disastrous for the company, there could be reason to sue. Google removing "don't be evil" is a meaningless change - it changes nothing. Google deciding that it was going to shut down all of its technology properties in favor of becoming a package delivery company would be a massive change and investors could sue that it wasn't the right direction for the company and that Google was ignoring their duty to shareholders.
Companies can change direction, but they also have duties. For-profit companies are entrusted with your investment toward a goal of earning money. Non-profit companies are entrusted with your donations toward a goal of some public good. If they're breaching their duty, a lawsuit is reasonable. I'm not saying OpenAI is breaching their duty, just that they aren't free to do anything they want.
Not exactly - they changed from a non-profit funded by donations to a for-profit/non-profit hybrid with the non-profit funded by the for-profit.