As though moving production to China wasn’t something the West did intentionally.
And now continues to push manufacturing out of Western countries by, for example in the UK and Germany, and Australia too, making electricity and gas so expensive it becomes cost prohibitive to manufacture much at all.
That's not really what happens though. You don't actually "lose" capacity, you just move to higher-valued special niches within the overall industry because (1) you can afford to, while low-cost competitors can't and (2) you can no longer expect to be the lowest-cost supplier for the bulk of the market. That's a win-win development and something to be encouraged.
That's not what people mean by "lose" capacity.
Suppose DRAM companies expand capacity because prices are high, then demand levels off, the price crashes, and they all go out of business except for the one in China which gets a government bailout. That's fine, right? We're not interested in making DRAM, that's a fungible commodity, we want to make iPhones or something. (They make those too anymore, but never mind that.)
What happens now if China restricts what you can buy to give an advantage to their own companies who are trying to displace you in the higher-valued special niches? Or just raises the price for you and not them? What if there's a trade war? Or a conventional war?
When you still have a domestic industry, you go to them and have a source for the commodity. If only one country becomes the sole global supplier and that country isn't even particularly friendly, that's bad.
You can't just spin up a 2nm wafer fab when the latest you've been running is a 300nm process.
Compare: US shipbuilding industry to China or SK.
Factories, tooling, supply chains, and engineering knowledge aren't fungible in the way they would need to be for your statement to be true.
"easily" is doing a lot of work in that sentence. Depending on the good and what they switch to making, this may neither be easy nor quick.
the question is if single country can carry all these industries at loss for prolonged period of time.
Another approach is to rely on international supply chain and speed of innovation, we can't produce steel domestically profitably today, fine, we may buy it from diversified international supplier network, and rebuild it fast tomorrow if needed using new tech, and focus on many other high margin verticals, instead of putting many billions of resources into infra which could be obsolete tomorrow.
There are more elements to it though which can be sort of hard to explain.
There are whole cultures and ways of thinking built around production. The children of engineers who worked on xyz v1.0 have a genuine advantage when its time to work on xyz v2.0. There is a lot of tacit knowledge in these engineering fields and you have a huge advantage in knowledge retention if you can maintain unbroken chains of succession.
You can't achieve the top levels of ability (decades of experience, generational knowledge) if you are whip-sawing production to and fro across the globe every 10 years.
There are also cross pollination effects. Being in the same community with as many related fields as possible (co-located) is what drives cross-pollination and mobility of ideas and people between industries.
Think how many countries have tried to copy "silicon valley" and failed, and _why_ they failed.
What I'm saying is that technology is built by _people_ and there are human reasons why having local capacity is beneficial for all the related industries in the area.
my point is that other children with no extremely heavy investments into perl v1.0, will have some skills in c++ v1.0 and python v1.0, and will have advantage in adapting Tensorflow v1.0, which is more valuable than skills in perl v2.0. Heavily investing in one industry you sacrifice some flexibility.
So, this is multifactor analysis, lets say wise American people will elect me as next president, I would create list of industries, assign metrics (national security importance, potential revenue in 5y from now, impact on other industries, potential margin, risks of failure, etc), then build some formula which aggregate those metrics into single, and base on final metric allocate weighted funds to support N top industries.