Besides the points made already, it's IMO misleading to think about what's rational for a country as a whole. A war can be rational for the coalition in power in one of the countries without it being expected-positive-sum even for that country. (Never mind pure mistakes.) This is historically common, I'd guess more common than not.
It bugs me that thinking of states as rational actors is called "foreign policy realism".
It bugs me that thinking of states as rational actors is called "foreign policy realism".