Having dealt with a thankfully much less but still similar situation
I think if a person representing the state had mouthed off like that in public or in my hearing, I would have found some incredibly effective way to reduce that person's carreer to ashes.
The Judge in this case should at the least be up for judicial review for malpractice and behavior not becoming a judge.
Any possible connection between the parties he obviously inappropriately helped should be investigated.
This kind of incompetecnce is seldom unaccompanied by corruption.
Ed
