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…
I'm of the opinion that things like shipbuilding don't really matter in times of war for countries with nuclear weapons. There would be dire consequences for anyone invading and/or blockading a nuclear armed country. A lot of people seem to yearn for the "good old days" where we built giant, tangible things that did cool stuff. That's fine, but the "national security" arguments ring hollow as you're basically saying…
But I do think that you're right in that the time of the frigate and aircraft carrier is over, and we'll all more likely to die either from a nuclear missile or from a 50 gram autonomous drone. I agree: the national security argument is hollow.
There are other reasons to build ships though, and some degree of self-sufficiency is always sensible.