Before reading this post, you should read Revolution Under Siege Episode 27: The Devil’s Wake.
Stalin served as chief political commissar for the Soviets’ South-West Front, commanded by Egorov. During the decisive weeks of the war, the Red Army’s commander-in-chief Kamenev ordered Egorov and Stalin to move their forces north; instead of concentrating on Lviv, they were to help Tukhachevskii take Warsaw. Stalin and Egorov ignored these orders and carried on with the failed attack on Lviv. For this, Stalin was removed from his post and he was never again let anywhere near frontline command. There were commanders during the Civil War who were shot for less.
The appearance of the Red Cavalry somewhere to the south of Warsaw would have prevented the Polish striking force from driving into Tukhachevskii’s left flank. Davies elaborates: ‘The real puzzle is why Stalin ordered the [Red Cavalry] to besiege [Lviv] on 12th August, knowing full well that it was due to be transferred to [Tukhachevskii’s front].’ Perhaps Stalin wanted to foil these plans for regroupment by presenting them with a fait accompli.’ ‘Look- we’re already attacking Lviv. Can’t pull back now! What a shame!’ Trotsky would later allege that Stalin wanted to take Lviv to enhance his own prestige. If Tukhachevskii would soon conquer Warsaw, Stalin thought hedeserved to conquer Lviv. Davies asks, ‘Was it to spite Tukhachevsky, as Trotksy said?’
So far, so damning.

But Lviv and Warsaw are over 300 kilometres apart. It is not certain that anything Stalin or Egorov could have done would have made a difference at Warsaw; on top of the irresponsibility of abandoning the Galician campaign, it is doubtful Budennyi, for all his ability, could have even covered the ground with sufficient speed. It was too late in the game. The key strategic mistakes – crossing the Curzon Line, advancing full-speed on Warsaw – had been made long before, and they had been made by people other than Stalin.
[Davies, 216-218]
But if you read Wollenberg (and you should), you will find an argument, backed up by copious reference to Pilsudski’s and Tukhachevksii’s memoirs, that had Stalin and co acted differently it would have made a huge difference. The Red Cavalry didn’t have to gallop all the way to Warsaw, only advance far enough into Poland so as to threaten Pilsudski’s right flank. Then the hammer-blow of the counter-offensive might have had to stall before breaking the Red Army, or might have not fallen at all.
I think Stalin’s actions did contribute to the defeat. But that is not to say they prevented a certain victory. Had the Red Cavalry gone to the aid of Tukhachevskii, they would have prevented Pilsudski’s counter-offensive but they would not have fixed the extremely challenging strategic situation in which the Red Army found itself in August 1920.