It seems like Stalin's denial of the possibility of a German attack even as those attacks were happening were hugely detrimental to the war effort. Stalin himself even suspected at one point that he would be arrested and removed from power. Why wasn't he? It seems like everyone in the country hated his guts.
Because during the 1930s he purged everybody in the Communist party capable and powerful enough of independent political action, and a new wave of those people did not arise until 1945. The Communist party of the early 1940s was utterly dependent on Stalin to function and every major player was one of Stalin's sycophant. They simultaneously feared, admired, and depended on Stalin as their leader and supreme pontiff of their international creed.
According to Court of the Red Tsar by Simon Sebag Montefiore Stalin was utterly despondent and retired to his dacha in the weeks after the invasion. He was reportedly to have said "We have fucked up, Lenin built our state and we fucked it up". He relates a story told by IIRC Mikoyan, of a meeting in which several members of Stalin's inner circle went to the Dacha to convince him to come back to lead the country.
Upon meeting Stalin, Stalin reacted with fear and asked why have they come. Mikoyan later wrote that at that moment it was clear that Stalin thought they might have came to arrest and depose him. But instead they insisted that he return to his leadership position and lead the country.
Of course, Montefiore also proposed this might have just being one more "act" put on by Stalin to force his subordinates to ask that he return to power so that they cannot question the legitimacy of his leadership later on.
Above all, what this show is Stalin's utter control over the Soviet Union and the Communist party after the purge of the 1930s. Even in his weakest hour, physiologically and politically, the remainder of the Communist party did not feel the confidence to either depose of him or function without him.