So far as I know, Stalin was devastated when the Germans attacked Russia and it took him ages to recoup his confidence. The Russians did change sides, however, old thing.
The USSR was never on Nazi Germany's side. Perhaps you can inform us of the part they played in the invasion of the Netherlands and France, the campaign in North Africa, the Battle of Britain, etc. All Stalin did was move his border a few hundred miles west to make the expect German invasion more difficult.
The German General Staff was correct in telling Hitler that it was too late in the year for an invasion to succeed in 1941, even though the Soviets had started to dismantle their defense-industry and move it East out of reach of the Luftwaffe.
It seems that your knowledge of Stalin's state of mind might be ill-imformed.
He told me when he was 8 he was running from bombing of his village. He was holding hands while running with his friend. He said an explosion happened kind of close and he was still running and looked down and saw that he was still holding the arm of his friend. Just the arm.