Relatively free flow of trade (not exactly the same thing as “free trade”) also did a lot to make the US the greatest industrial power on the globe and (turned to that use) the greatest military, economic, and political power on the globe. Historically, we are far from the only example.
The real problem is that we’ve thrown nooses (note the plural) over ourselves that hamper our abilities (note the plural) to compete. And again, we are far from the only example.
I will point out, though, that it is preposterous for anyone to suggest that using U.S. Navy assets to protect foreign civilian ships carrying foreign cargo is the right way to deal with any of those challenges.