The best time to try and fix this is 20 or 30 years ago, but absent a time machine, the next best time is now. Either you feel this kind of construction process is national-strategic and you ignore the cost over imports, or not. If you don't regard this as a core competency which should be kept in the national register, then sure, buy the ships from other places. But, don't come whining when the national-strategic in…
Every country should be able to defend itself, without reliance on allies, as a national priority. If this means building cars, ships, tanks, and planes, then that infrastructure should be built and maintained at taxpayers expense. Whats more, you need to have market forces within your own country so competition can deliver you the best products. You can't just fund one ship building company, you need to roll the dic…
This is unrealistic for smaller countries, like Ancient Greek poleis or contemporary Estonia. Under your logic, they would have to give up their existence and join some empire.
In practice, already the Greco-Persian wars are an indication that alliances of smaller nations are viable, and that they are more efficient due to specialization. This is not a new problem, nor is it specific for post-industrial history; the Athens were better at fighting at sea, other poleis could provide hoplites.