You are correct that LEGALLY you can not fire an American employee and replace them with an H1-B. But that is exactly what IBM did with me, and I understand it is still happening. CEOs are not following the law.
As to outsourcing, I've personally witnessed that happening as well. Companies will do anything they can get away with so that their CEOs can make more money. It's wrong.
And I agree, it does boggle the mind that any advisor to a president can get away with saying American workers are r**t@d. But this is Musk, who has bought Trump.