[1] https://en.wikipedia.org/wiki/General_Agreement_on_Tariffs_a... [2] https://en.wikipedia.org/wiki/Uruguay_Round / https://en.wikipedia.org/wiki/Agreement_on_Agriculture [3] https://en.wikipedia.org/wiki/Doha_Development_Round
Don't get me wrong though, I'd prefer a world without the need for nation states and borders - but as long as we do have them IMO some of these international organisations are overstepping, and WTO is near the top of that list.
Of course having to protect this very wide range of domestic industries to maintain true independence will result in a huge loss of economic efficiency; so even if it is done right (without an "oops, we forgot the bit about the fertilizer" issue), not only do you have to be a rather large country with a lot of resources, you also have to accept a significantly lower standard of living and a degree of backwardness.
How much it helps I'm not sure; Britain for instance managed to feed itself during WWII even though it relied on its navy for food shipments and of course its cargo ships were constantly attacked. Certainly it did better than it would without a strong navy but with an independent domestic agriculture, since it would have been invaded.
On the other hand, presumably importing vitally important things without exporting vitally important things in return might put you in a bad bargaining position in international politics in times of peace, and maybe then domestic industries making sure that you can survive without imports are helpful; though even that doesn't seem like a huge problem unless you're importing from a cartel (and even very powerful cartels sometimes break down, the way OPEC did recently.)
As to agriculture - I sincerely think it's protected because producers simply bribe the people in the government; there was even research that the more concentrated and bigger ag producers are in a country, the more protected they are (even though a lot of the nominal arguments for protection are much stronger with many small producers than with few large ones typically employing fewer people), though I didn't look deeply into it and perhaps the researcher was biased by expecting this conclusion.