The idea of economically enforced peace only works for democratic countries where the government has to show at least a bare minimum of respect towards its citizens, but not in countries that follow the whims of their respective Dear Leader.
https://en.wikipedia.org/wiki/The_Great_Illusion
Wars are often irrational.
At the time international trade was still fairly minor, so although a war would be deeply unprofitable it'd still be possible. Today's economy looks quite different, with even basic consumer goods coming from overseas. If international trade were to suddenly cease, most major countries would be in serious trouble really quickly.
The most extreme example of this is the European Union. Its economies are so deeply interwoven that they act as a single entity. Separating them to the point that one of its members can independently support a war economy would take decades, so it does indeed make intra-European wars virtually impossible.