They were purged because of a clever ruse perpetrated by the Nazis. They used fake radio messages to make Stalin's secret police within the Army think that his officer corps was full of spies and traitors.
Stalin fell for it hook line and sinker, and had roughly one-third of his commanders shot by firing squads.
There’s a cultural arrogance about Russians. One of their sayings goes, “Nobody can ever speak Russian without an accent unless he’s born here!”
Apparently the Germans fooled Stalin, who BTW spoke Russian with a thick Georgian accent. How thick? According to Solzhenitsyn, Stalin speaking Russian sounded like a Russian speaking heavily accented English.