This is just like Canada banning foreign investment in real estate. It admits there's a problem, data harvesting , homes as investments, but just solves a small part of the problem pertaining to "foreign bad guys" while ignoring the larger domestic issue.
All it does is make the government look like they did something without actually confronting the powerful interests that are causing the problem.
You can if the company is a non-profit like open AI. Basically when you take on investments for a company you declare what the goal/purpose of a company is, either to make money (for profit) or for some other nebulous cause (non-profit) eg. Ending hunger or saving humanity from AI. If an investor thinks you aren't following that goal and are pursuing some other goal then they can sue the company.
Sadly most companies are for profit so they can only be sued if they're trying to do something that doesn't optimally make money. So a fossil fuel company can't be sued for legally dumping poison into the air if it's the most cost efficient method, but they can be sued if they do a less cost efficient solution that would make air quality better because improving people's health isnt there goal, making money is.