The article you linked to was jailed for not listening to the judge. Yes, it was about his refusal to wear a mask in the court. But if someone in court talks while the judge talks and the judge commands them to be silent, the judge can jail that person for refusal to be quiet. Or if they eat in court and refuse to stop eating. Or any number of things that are completely legal outside the courtroom.
So that is a bad example.