Here is the crazy thing for the invasion of USSR and the Barbarossa plan in particular. Moscow was never initially a target. The only actual target cities they wanted to capture were Leningrad (to lock down that entire region and to link up with the Finns), and Kiev, the heart of the Ukraine. The plan was an operational masterpiece in terms of applying all the lessons learned from Poland and France. Plus they had the benefit of attacking a strung out and poorly positioned Red Army who were in the middle of a massive mobilization effort so most units were at low strength and didn't have full compliment of men, equipment, or pertinent supplies (like fuel, radios, or artillery rounds). But the craziest thing about Barbarossa is it had no tangible strategic objectivesI watched it too and even he thinks that the battle of Moscow in early 1942 was the tide turner. He says they got slapped there to the tune of one million losses. But to give the Germans some benefit of doubt, they had the whole of 1942, went south, got blocked, went south got blocked, went back up and got blocked, and by the end of 1942 it was pretty clear they were going nowhere.
Barbarossa called for defeating the Soviet Union (forcing Stalin to capitulate or be overthrown by his own govt) by destroying the Red Army's main force and reserves in Eastern Europe. The Germans planned on doing that by a three front advance to attack, encircle, destroy all Soviet forces before reaching the Dnieper River for Army Group Center and South. The Germans massively underestimated the Red Army's strength and its ability to mobilize reserves, I believe Barbarossa high number estimate was the Soviets would be able to muster a total of 175 divisions or something like that, and instead the Soviets mobilized +300.
The Germans had a level of success early on that even surprised them, so they kept driving. They suffered some pretty incredible losses at Smolesk, but they still managed to win big, so they kept going. The Red Army continued to fight, so they kept going. For every grand encirclement that worked, a bunch didn't and a good number of the Soviet forces trapped inside managed to escape (while battering the German panzer and infantry divisions in the process, which weren't being replaced). Supply difficulties were exacerbated since the terrain was far worse than anticipated, weather, etc., but also because the pace of the campaign was much faster, and the Germans were driving far far beyond what pre-battle logistic planners had said was the limit of their advance.
By fall 1941 it was grossly apparent that the Barbarossa plan was wrong. So the next question is, What do we do now?
German officers are incredibly good at operational planning. Masters really. But they're terrible strategists, because they dont' bother even factoring in anything related to grand strategy, let alone politics (as one of their own said, "War is a continuation of politics by other means." So the answer to the "What do we do now?" problem provided by the senior German generals was to do what they thought would work. Take Moscow. It worked in Poland, right? It worked in France, right? Forget that the Soviet Union extended across the entire continent westward and they had ample room to continuously fall back (which the Poles and French couldn't). Forget the fact that the communists of the USSR weren't Poles or French, neither of whom had a totalitarian govt capable of mobilizing their nations to the point that Stalin was capable of doing (especially after the bloody purges of the 30s, that left him with no rivals or political threats). The Germans factored none of this in, they simply looked at a map, guessed (wrongly) at the levels of Soviet resistance they'd encounter along the way when launching most of their Panzer divisions at them.
Hitler diverting Guderian's Panzertruppe to assist with the Kiev encirclement is talked about nowadays as if it was some massive blunder. Why? Because Guderian lived and wrote a book, Hitler did not. And because Guderian was one of those who thought taking Moscow would cause the immediate collapse of the Soviet Union (wrongly). And it wasn't just Guderian, it was a lot of the German brass. Hadler (who had crafted the disastrous Barbarossa plan), Bock, who was the commander of Army Group Center, their Hail Mary play was to take Moscow. Hitler initially didn't allow them too, and when he did it was "too late," but the reality was that taking Moscow would likely not have had any immediate impact on the war, it would just have placed the Germans best divisions deeper in Soviet territory, holed off in a city they now had to hold at all costs, during a major coming Soviet winter counterattack.
But did the Germans lose the war in 1941? No, they just didn't win it.
By spring of 1942 they were rearming their divisions, sending new draft units out to fill out the battered ones, sending entire new divisions out, a whole lot of new equipment to replace that lost (including much needed tanks). Getting supply lines fixed a bit, stockpiling supplies, readying for a new offensive, Case Blue.
And Case Blue initially had nearly as much success as Barbarossa. But it too was an unrealistic plan hinged on a logistical and manpower/equipment replacement system the Germans just didn't possess until the very late stages of the war (if that). But when Case Blue stalled in fall 1942, and then turned into another disaster, did the Germans lose? No, they just didn't win.
The truth of the matter was the outcome of the war was never truly guaranteed until 1943. At that point it became grossly apparent that the Germans could not sustain any sort of strategic or operational offensives. And staying on the defense just doesn't work, one cannot win, or even survive, strictly fighting on the defense, offense is still necessary. Between the Soviet Union (who was growing larger, better equipped, and more important, better organized, led, trained), with the Western Allies starting to come back into the picture in North Africa, Sicily, Italy. With a guarantee that France would be invaded (it should have happened in 1943, but that's another story). With the battering of Germany by the RAF and USAAF, in which the Germans had no real way to stop it or retaliate effectively. With worsening supply problems (every bit of lost ground was factories, mines, slave workers lost). That was when the Germans were doomed.
But even then, its easy to say Germany is going to lose the war eventually. Its quite another to make that happen. And all told, I doubt the Soviet Union had the ability to make it to Berlin without the US or UK's help (Lend Lease, Ultra, etc).