Look what happened to Hu Jintao at the last party congress. However, China is pretty mellow about this: presidents/party leaders are allowed to retire gracefully since Deng Xiaoping set that precedent. I don't see even Xi or his successor breaking that contract.
If you make it to the very top, perhaps, but plenty of people at the pinnacle of power have been jailed. Here's the guy who lost the power struggle to Xi:
Bo Xilai had it coming to him by having that British guy murdered. Even though they pinned in on his wife, he had to have known. That wasn't so much of a lost power struggle as it was "you crossed a line even high officials cannot cross."
But if you give them enough rope and fall out of favor, ya, you will be made an example of. It is difficult to make it very high without creating lots of rope, however.
Losing an election in the US just means you are out of a job - and lose all its perks.
Losing power in an authoritarian government could mean you are arrested for “corruption” and sentenced to death.
The paranoia (and occasional country sabotaging acts) of CCP critters are justified as it’s a no holds barred fight for power and survival.
https://archive.is/d9OsU