Stalin was not naïve, he understood that destiny almost certainly meant a clash between fascism and communism. He miscalculated, he thought the Ribbentrop/Molotov pact would precipitate the war but a war between capitalists that would exhaust both sides.
He did not anticipate that Nazi Germany was capable of defeating France and everybody else in 6 weeks. He foresaw a a grinding war of attrition like the First World War that would weaken contending capitalists.
Stalin was to pay for his crime with more than 10 million Russian lives in due time. The cynicism of Russia extends from Czars to commissars and Vladimir Putin.

Excellent analysis.