The thing was the Soviet Army was preparing for an offensive war and had no plans for a defensive one, Hitler likewise was preparing for a offensive war with Russian, he just happened to attack first and the Russians had no counteroffensive, add to that Stalin was in totally denial and in a mental paralysis as to what to do and waited several critical days before he even was able to respond. The Soviet Army literally had to regroup and figure out what to do. It is estimated that the Russians lost 30 Million in that war.
Stalin signed the Non-Aggression Pact with Hitler with the expectation that the British, French and German armies would bleed each other dry as in WWI, allowing the Red Army to swoop right in.
He didn’t count on France falling so soon.
Hitler should have been prepared to offer the Ukrainians autonomy. He would have had a lot of Ukrainians volunteering to fight the Red Army. That’s a big chunk of land right there.