I don’t think this playbook works for complex products. Before every component needed for an iPhone is locally manufactured, the overseas competitor manufacturers of those components would be many generations further. You’d be competing with the whole world.
The designers of the chips in the iPhone are basically US entities. (And more generally, Apple, Nvidia, AMD, Qualcomm, etc. are US companies.) They can gradually limit foreign production and re-shore with subsidies.
Sure, foreign chip manufacturers might gain a leg up, but it might not be totally ruinous. There's a way to do it that's smooth, gradual, and mostly painless.
The US has maintained full employment for quite a long time now. You can bring the factories to the US. You can likely even automate a lot of the work. But not all the work – in a place where everyone who wants a job already has one.
So, the question really is: What are Americans willing to give up? Something has to go if workers are reallocated away from whatever they are doing now into these factories.