Quote from here: https://www.esa.int/About_Us/ESA_history/50_years_of_humans_...
> On 23 March 1938, Valentin Glushko was arrested. To reduce his charges he denounced Korolev, which resulted in his arrest on 7 June and a sentence of ten years forced labour. From that day on, the two men were bitterly opposed to each other.
So as you can see he was not sent to gulag out of spite by Stalin but out of envy and professional competition by his fellow rocket engineer.
While in gulag he was not tortured or sent to gold mines. He and other scientists continued their work in relatively comfortable conditions in so called "sharashka": https://en.m.wikipedia.org/wiki/Sharashka
I'm not saying that Stalin was a saint or a winged seraph. But definitely he was anyone but an idiot.
Also Korolev did not died because he was sent to the Gulags. He died from a chronic disease from which he started suffering long before he was imprisoned.