At some point you start to create perverse incentives that way. When the punishment for getting caught is the maximum punishment available, then a criminal might as well go all-in to make sure they don’t get caught.
So if the punishment for (say) assaulting a cop is death/life without parole then the the crook might as well finish them off to make sure the cop can’t testify against them. If the punishment for prosecutorial misconduct is death/life without parole then the crooked prosecutor might as well continue to use all the power of their office to continue the coverup.