The short answer: almost never.
Judges are shielded by a rule called judicial immunity. This rule says you cannot sue a judge for their court work. It does not matter if the ruling was wrong. It does not matter if it seemed unfair. If the judge was doing their job,