Just to clarify, what's said above isn't what happened here (not replying to a 5 month old post directly). This is similar to cases in real life where, due to immunity or some other circumstance, a person can't be tried or investigated on the most serious crimes they committed and is, therefore, brought in on a more minor crime which is given the maximum punishment and allows investigation into other crimes. He wasn't executed because he wasn't liked, it was because he was using his special immunity and status as a representative of the crown prince to harass and assault citizens. For royal proxies, law doesn't apply, only the discression of royalty. Since he would abuse royal authority, he is harshly punished by royalty to protect the seat or authority of royalty. This both sends the message that this isn't tolerated, suppresses the crown prince's bad behavior, and saves face for both the crown prince and the royal family as a whole. If we aren't speaking in utilitarian terms and only of if it is moral or just, those with the greatest authority must be met with the harshest punishments. He was given a special status of trust that allows him to ignore the law by royalty so royalty must hold responsibility for removing abusers and making sure such a person is not simply reinstated later due to corruption or flaws in their system.