Lenin and Trotsky both tried to stop Stalin. But Lenin was ill and Trotsky didn’t push hard enough when he could have.
Inherent in all this an apparent contradiction (or at least a problem) with revolutions. Those that you knock out of power are often the same people that know how the system works, the ones that keep the factories going and the electricity on. They are the ones that run things on a day to day basis. Push them out and things might stop functioning smoothly. Venezuela had this happen recently when they nationalized the oil companies and fired most of those who ran them. Production dropped 20%.
Those you want to push out of power might also be the same folks you need to run things. How do you keep that same strata, those who run things in a society, from forming a self-perpetuating class beholden mainly to itself? The USSR under Stalin had a ruling class with power capitalists could only dream of having, with no institutionalized checks and balances either. Then the horrors began.