Comparative advantage theory also ignores that efficiency increases as you invest in an industry, and the acquired expertise helps related industries.
It especially ignores how another country can also buy/"partner" with your companies, and export their expertise to help their own companies, and harm yours.
A simplistic model that ignores a wide variety of behavior economic and political actors can and do engage in, yet that didn't stop economists from swearing up and down that there's nothing to worry about.