What companies are enjoined from doing is purposefully working against the interests of the corporate good (and by extension shareholders). What that “good” is, is very fuzzy. But roughly speaking it means you can’t take gross actions that will clearly significantly harm the company, and that you know it will cause harm.
A good example would be Twitter. If it was still public, I think a case could be made the Musk took a number of gross actions that directly and materially harmed the company.