A hyper-specialist will be the best at some thing or another, and bad at a lot. A generalist will likely not be as good at those things, but it can be good enough at them, and not nearly as bad at the other things.
The market, as you note, selects for hyper-specialists, but crises aren't kind to them.
Strictly inferior home-produced goods are better than no goods at all, and the capability to produce them may have systemic benefits (in flexibility, resilience, avoiding certain kinds of path dependence and local maxima) that are not visible when looking at the goods in isolation.
What law and regulation can do is keep a nation on a more generalist footing, and keep it from hyper-specializing too much.
The market, as you note, selects for hyper-specialists, but crises aren't kind to them.
Strictly inferior home-produced goods are better than no goods at all, and the capability to produce them may have systemic benefits (in flexibility, resilience, avoiding certain kinds of path dependence and local maxima) that are not visible when looking at the goods in isolation.
What law and regulation can do is keep a nation on a more generalist footing, and keep it from hyper-specializing too much.