That has been the prevailing thought since before WWI, but multiple World Wars and Russia's invasion of Ukraine this year have proven otherwise.
Do you know who was the biggest trading partner of Nazi Germany on the eve of Operation Barbarossa? You guessed it, the Soviet Union. It was responsible for the vast majority of imports of critical resources like various metals, oil, grain, etc. It didn't stop Hitler.
Do you know who were the main buyers of Russian gas, and via which country that gas arrives to them? You guessed it, EU, and the main pipelines pass through Ukraine.
On paper, yes, you're absolutely right. But you're assuming rationality where it's far from certain. Same as in the 1930s, we have a bunch of empty populists everywhere who are anything but rational, intent on blaming everything bad on "bad guys of today", be it the EU, migrants, Soros, the Jews, Nazis, have your pick. With those types of people, you can't assume rationality of actions. Brexit wasn't a rational decision, to give but one example. Poland infringing on press and human freedoms against the will of the EU, while receiving billions of aid from the EU, isn't rational.