This question is fun! Observe Liangshan heroes using modern law.
The first thing to say is that if this is true, then there are no good people on Liangshan, and they have not escaped at all. Every one of them is a criminal. There was only one reason. The Northern Song Dynasty court was the law, but the Liangshan Group engaged in militarized confrontation. This alone was doomed.
However, it would be too absolute to say that all the people above Liangshan are "death prisoners". Let's put aside those little minions and say that the 108 generals in Liangshan are some of the heroes who should not be sentenced to death.
For example, Xiao Rang, An Daoquan, Huangfu Duan, Jin Dajian and other skilled Liangshan heroes, what did they do? Not only did they do nothing, but they were all deceived or forced into danger.
For example, An Daoquan is a miracle doctor, and he already has a lover. Although he is a prostitute, but he is willing, what can you do? But when Song Heizi got sick, Zhang Shun came over and killed his lover. He also imitated Wu Song and wrote, "Whoever kills, be safe!"
Okay, what can Doctor An do? He had no choice but to follow Zhang Shun to treat Song Heizi. Later, he became a military doctor on Liangshan Mountain, always saving people and never killing.
This is also the case for Xiao Rang and Jin Dajian. One was a folk calligrapher and the other was a folk sculptor. Song Jiang wanted to behead because he wrote anti-poems. In order to save Song Jiang, Wu Yong deceived the two men into Liangshan. One imitated Cai Jing's notes, and the other faked Cai Jing's official seal.
What can these two people do? Is it okay if you don’t do it? His head would be chopped off on the spot. That's Liangshan, a den of thieves! They could only do as they were told, and then both of them kept to themselves, doing some artistic work, technical work, writing and engraving, and never killed anyone.
Therefore, even if Liangshan is wiped out by the imperial court, these technical experts will not be sentenced to death.
In addition to these technical experts, there are a few others who are not up to par. Such as Zhu Tong.
He was completely a victim and did not want to live in Liangshan, a den of thieves. However, he was deceived by Wu Yong, forced by Li Kui, and coaxed by Song Jiang and Chao Gai, and was sent to Liangshan. And after going to Liangshan, Zhu Tong almost didn't show much. It was only after he was recruited that he suddenly broke out. Therefore, at least Zhu Tong will not be sentenced to death.