As they say, hindsight is 20/20.
Even to the generals of the time, some glaring problems should have stuck out to them, though they managed to delude themselves into thinking they could do it. The initial German plan called for destruction of the Russian army in 13 weeks, followed by two weeks to rest and resupply, then finishing up with a railroad advance into the Russian interior. When they were told, following a logistics exercise, that the invasion force would run out of supplies long before the 13 weeks they'd allotted themselves to destroy the Red Army, they revised the plan to destroy the Russians in nine weeks. They disregarded intelligence on Soviet strategic assets beyond the Urals, the evacuation of Soviet rolling stock, and destruction of the water towers necessary to keep train engines going.
They did not account for the difference in reserve personnel; besides the five million men in the prewar Red Army, the Soviets had another 15 million or so reservists with two years of military experience. By comparison, the Germans had every man they could get in the active duty military, or working in a war critical industry on the homefront. The Germans had numerical parity at the beginning of the campaign, but they only accounted for the Soviets raising 2 million more men in the next six months. When they called up reserves, they raised 4 million in ten days. What makes this an inexcusable oversight is that this system of building up manpower reserves through short term conscription was a German innovation, and unlike their army, the Soviets did not have manpower limitations or a minimum term of service lasting twelve years.
The High Command banked on a political collapse in the Soviet state, and neglected to plan for a campaign dragging into the next year or the year after. This ran completely counter to the German tradition of contingency planning, and they really should have known better than to bank entirely on a single course of events.
One factor that has not been brought up but that is rather essential:
The viability of the planning and military considerations aside for a moment, it is imperative to not forget that the attack on the Soviet Union was not just another or just any military venture. It was predicated and precipitated by an ideological requirement, which was to stamp out the threat of Bolshevism.
As Johannes Hürter in his study of the leading figures of the attack on the Soviet Union has pointed out, by the time the attack was decided in 1940, the Wehrmacht leadership had nazified itself and had thrown previous considerations in the wind. For the Wehrmacht generality as for Hitler himself, the attack on the Soviet Union and the idea of engaging the Soviet Union in a war of annihilation was an ideological necessity brought upon them by the perceived threat of Judeo-Bolshevism.
This attack was even more than taking revenge on France what the war was about really. It should bring an end to "Jewish threat" Germany was facing. It should be the harbinger of German domination of the continent as was its "historical mission". It should bring the Lebensraum that would finally allow Germany to take its rightful place in the world.
It can not be overemphasized how completely and thoroughly the Wehrmacht generality was ideologically and practically complicit in Nazism at that point in time. This can be further gleaned not only from the planning of the attack itself but also the Kommissarorder, the Barbarossa order or Eduard Wagner's role in the Generalplan Ost.
Operation Barbarossa was a plan that had to make due with the current situation out of ideological convictions and practicality took a back seat to this. Whatever was necessary had to be done. So when looking at what the actors knew at the time, failure was not an option for them because in their minds, this attack was "just", "necessary", and about to bring the future of Nazism ruling over what was historically "rightfully theirs".
Sources:
Johannes Hürter: Hitlers Heerführer. Die deutschen Oberbefehlshaber im Krieg gegen die Sowjetunion 1941/42. Oldenbourg, München 2006.
Wolfram Wette, Gerd R. Ueberschär: „Unternehmen Barbarossa“. Der deutsche Überfall auf die Sowjetunion 1941: Berichte, Analysen, Dokumente. Schöningh, Paderborn 1984; erweiterte Neuausgabe: Fischer Taschenbuch, Frankfurt am Main 2011.
Gerd R. Ueberschär: Der deutsche Angriff auf die Sowjetunion 1941. Primus, Darmstadt 1998.