Well it cost 20 million Soviets dearly, Stalin was fine. And in the end, he was even more powerful by the end of the war. The Purge may actually have saved his neck, because odds are, had he not done it, he would have been overthrown when the Nazis invaded. But people even then were too scared to go against him.
Had he not purged his military, the Nazis wouldn’t have gotten as far as Moscow.