The purpose aligned pretty much with your observations and the utility of this was involved in building a billion+ of devices.
I did see one case where it sort of made sense to offshore to China, and then only to have production near some other markets. The company literally prepared and shipped only the final secret input chemical and it's curing agent, to be mixed in a certain ratio, poured into a big vat, then cut into slabs. They were still wicked nervous about it, and I don't think the arrangement lasted long.
Even if all the components are made here, with all the materials engineering, CNC machining, molding, forming, fabrication, etc. done here, and only final robotic assembly done in China, that is still a non-trivial skill to program and maintain those robots. And at that point, it's only a few experts, so why ship it and not keep it here?
They made sure that the availability of components for all these global (mostly US it seems) companies wanting to rent time in their factories would face minimal supply chain difficulties, by making the component availabilities a local thing.
It's very orthogonal to all you mentioned, which I agree is logical. Also, programming the robots could be done domestically, then binaries of the programs run in the contract manufacturing facilities. Point is, I think what you emphasize actually has long been a priority.
Even if, and especially if, a mfg process is highly automated, it takes myriad layers of expertise to get it right. That is the LAST thing you want to ship overseas to your adversaries, which both increases their expertise in the field and your dependence on them.
Economically, it is long-term-stupid. Strategically, it is suicide.