I’m not a lawyer, but it would seem like that Flynn (if the judge does anything really stupid)...can then sue the judge for civil action, and taking away his civil rights.
Judges have absolute immunity. Really.
Suing the judge is almost never an option. Judicial immunity isn’t absolute, but it’s nearly impossible to overcome. If the judge is performing a judicial act, and has jurisdiction, there is no suing him. Ruling in a case is a judicial act, and there’s not a jurisdictional issue in the case that I’m aware of, so appeal would be the only remedy for a bad decision.