These kinds of objections always come up. "But, rich people are oh so clever, and they will exploit loopholes in any law that gets written!" Well, write stronger laws. Don't include exceptions. Lawmakers need to think more than 5 minutes about what kinds of options/resources are available to people, and how those people might game their way into getting around the spirit of the law.
Ex post facto laws are illegal.
Even so, you might get the taxes once, before they leave. That's not a plan for a future.
And, It's not like they're all going to leave. Sure, a few grumpy ideologues like Musk will Go Galt and move away, but it's not like everyone subject to the tax is going to suddenly leave. People have been predicting the demise of California, New York, and so on forever, yet somehow, they have not all moved to Texas yet, and we still have plenty of high-earning taxpayers here. Maybe they like clean air and a functioning power grid, I don't know.