I have seen some pretty compelling analysis that Germany had to go to war with the Soviets in 1941, and rather than it being some mistake, was a necessary and unavoidable action by that point because of the economic situation that the Germans were in.
Kind of like Japan with regards to attacking Pearl and the European colonies in the Pacific. At a certain point it was either expand the war to acquire resources, or give up on the war and gains made thus far (for them in China, for Germany in Europe).
Yes, this is excellently laid out in Adam Tooze's Wages of Destruction. Hitler and the Nazi Party had a Manichean worldview of politics as a zero-sum struggle between races for dominance. The Jewish conspiracy had controlled Anglo-American capitalism to defeat Germany in the First World War, and if Germany failed to take over Europe to establish a continental empire that could counterbalance the United States then Germans would inevitably be enslaved in the American world order. Operation Barbarossa was a desperate gamble with little chance of success, but for the Nazi leadership a total war of ever escalating gambles was the only alternative to Germany's subordination and destruction at the hands of greater powers.
I think the logic was similar for the ultranationalists in the Japanese military: they could abandon the conquest of China, but it would be a total failure in the face of American hegemony and be tantamount to allowing the United States to carve up and colonise Japan.