Perhaps more importantly, it provides a national strategic interest that is not easily captured through economic analysis. When times are good and international trade happens smoothly this is not important, but when the international market breaks down for some reason, having domestic production gives our government more options in how to respond.
We saw this with covid, when every nation was scrambling critical resources to deal with the public health emergency. We see this now with Russia, who is regretting how dependent they on foreign trade; and in Europe who are regretting how dependent they are on Russian energy.
Yes, I know if you write software for a medical device, the FDA will have to approve it.
https://www.scmp.com/economy/china-economy/article/3167588/c...
Also, Chinese restrictions on companies restrictions on foreign companies pale in comparison to the freedom they enjoy in the US.
https://www.aljazeera.com/economy/2021/12/28/bbchina-unveils...
https://www.cnbc.com/2021/09/28/enticing-china-market-tricki...
Google, Facebook and Twitter are all banned in mainland China.
https://www.cnbc.com/2020/10/12/chinese-app-that-let-users-a...
https://en.wikipedia.org/wiki/List_of_websites_blocked_in_ma...
Meanwhile, TikTok and the likes are freely allowed to shape our minds.
Blocking foreign companies is a form of massive subsidy.