that's karma
if there was a way to be 100% sure someone committed a crime i would favor karmic punishments
murderer gets killed after his very reason for killing is taken
rapist gets raped or castrated
people that set others up for being the victim if a crime have to endure it themselves
but sadly you can almost never be 100% sure in real life in fact the times where you could have 100% assurety are so low in number that you can more or less ignore it as a possebility
so our punishments need to be standardized and excuse able in case the ruling was wrong or biased
how i envy story charackters sometimes