So long as the logistics held out, the Wehrmacht was doing pretty well, until the latter part of 1942 when the Australian 9th division beat anything German in their vicinity at second El Alamein meaning no-more-stuff-looted-from-the-British-to-supplement-North-African-Campaign-German-logistics (and over on the eastern front problems at Stalingrad started to spiral way out of German control.)All these threads come back to the same thing, people buy into the myth of the Wehrmacht as an unstoppable, invincible fighting machine. So on the occasions it was stopped this must have been either bad luck or a misjudgement on their part. I mean what their enemies might do is all but irrelevant. So because the Axis had a little more success in the Middle East than it did with Barbarossa clearly the mistake was not committing full to the Med. Sure Spain had little or nothing to gain from joining the war and the Nazi's could barely sustain the logistics of the Afrika Corps as it existed OTL and Germany can't get the resources it needs from the Middle East but there must be some way the Nazi's can win the war, it can't be that a bunch of lunatics plunged their country into a war with no clear plan how to win it and without the resources to fight it and just got incredibly luck for the first year or so?
Regarding the British the problem was that after the British did decide to fight on after Vichy signed the Bordeaux Armistice, to get a quick victory the Germans needed either to force the British into a position of economic collapse or gain supremacy in the Atlantic for long enough to starve the British - which smashing and grabbing stuff around North Africa didn't get them, and being at war with the United States, post Pearl Harbour, got them even further away from.