If it were a matter of industrial protectionism against a country which was not hostile, not authoritarian, didn't rely on slave labor, etc., then I'd agree with you. Countries have other pressing reasons besides immediate economic advantage to prevent this sort of thing.
To greatly oversimplify: Japan fought against opening their markets, as did China, out of political and social concerns for the stability of their states, far more than economic ones.
Doesn't matter though. The big mistake was allowing manufacturing to be exported from the US to begin with. Nearly any advanced technology we use or wish to produce is now dependent on China. They control not only the advanced manufacturing process, but also the refinement of rare earths (we can mine it but not refine it) and have cheaper labor. Not only can't we make tech without them, we can't sell it at competitive prices. Things will soon get worse as robotics and vertical integration makes Chinese products even cheaper and better quality. And we can't compete on robots because China controls that production chain too.
The smart play would be to build up our own green energy sector to gain cost savings, while investing in its manufacturing, so we can eventually compete and support ourselves (which Biden and Obama passed funding for). Trump eliminated all that when he came back, because the oil companies wanted more profits, they literally don't believe climate change is real, and they have no idea how diplomacy works. We could've had cheap battery, wind, and solar manufacturing in the US. Not anymore.