well in this case he would only know he would probably be sued because he was having an improper sexual relationship with one of the principles of a trial he was presiding over and she received a better deal because the judge wasn't impartial at all.
So in practical terms maintaining an impartial judiciary isn't happened with judicial immunity at all. Instead we are retaining incompetent wrongdoers at a high level. This guy isn't mature enough to be high school teacher, much less a judge.