only if you lived in that duchy, for others the risk is the family using its authority to punish you in other ways like having merchants or other nobles cut you out or hiring people to attack you in secret
This is like, death penalty for you, your family and your entire city in a medieval fantasy setting.....
In a way, it's similar to frame Jeff Bezos. If you work in his company (live in his duchy) you would probably get fired. On the other hand, if you work in another billionaire CEO's company, it would require Jeff Bezos to intimidate or barter with your CEO to punish you, or hand him over. Alternatively, buy the company (invade your duchy and rule over it) to fire you.
Obviously the analogy is not perfect, but you get it.
In addition, there's other things to consider. The first "crime" was about ruining a student's books and the other was animal abuse. While the second one is pretty heavy by our standards (rightly so) I believe the worse she would face is expulsion from the school (specially for the animal abuse). That is to say, while the protagonist is a duchess, she isn't being acused of treason or something geopolitical that would directly involve her status. I actually think most (sane) people would see her using the death penalty as an overraction. Specially if you consider (correct me if I'm wrong) this school is filled with nobles. You're not just killing a peasant, you're killing a noble! Even the first guy who framed her, he had literal connection to the prince! To royalty!
If you advocated for his death, worse, his entire family...that would rile up the entire nobility against you, which would force the royal family to also go against you, since they depend on the nobility. Why? Because it means you're alright with killing nobles, and well...they're nobles. I'm looking WAY too deep into this, but to execute a noble without angering the nobility you need a GREAT reason. Not just "this teenager accused me of ruining some books" but more like "he tried to assassinate me" type shit.
WITH ALL OF THAT SAID, i wouldn't mind seeing her killing them. LOL but I understand why she doesn't.