Nothing you've said invalidates comparative advantage. It is just accepting a cost (reduced economic output) in favor of some strategic advantage. It doesn't matter if its a good idea, or a moral idea, or a strategic idea, the cost is still a loss in economic output.
Sure, you can think of it as purchasing security with the cost of reduced economic output. The problem is that the benefits of autonomy, and the costs of the externalities of free trade, are difficult if not impossible to accurately value. Not only are they intangible, their true value can often only be assessed in retrospect.