Assuming this happened in NY, the Judge violated Rule 100.3(B)(6) of the NY Rules Governing Judicial Conduct
"(6) A judge shall accord to every person who has a legal interest in a proceeding, or that person's lawyer, the right to be heard according to law. A judge shall not initiate, permit, or consider ex parte communications, or consider other communications made to the judge outside the presence of the parties or their lawyers concerning a pending or impending proceeding, except:
(a) Ex parte communications that are made for scheduling or administrative purposes and that do not affect a substantial right of any party are authorized, provided the judge reasonably believes that no party will gain a procedural or tactical advantage as a result of the ex parte communication, and the judge, insofar as practical and appropriate, makes provision for prompt notification of other parties or their lawyers of the substance of the ex parte communication and allows an opportunity to respond.(b) A judge may obtain the advice of a disinterested expert on the law applicable to a proceeding before the judge if the judge gives notice to the parties of the person consulted and a copy of such advice if the advice is given in writing and the substance of the advice if it is given orally, and affords the parties reasonable opportunity to respond."
explains how to file a complaint, and has a link to the complaint form.
I hope this information is helpful.
DISCLAIMER: Answers from Experts on JustAnswer are not substitutes for the advice of an attorney. JustAnswer is a public forum and questions and responses are not private or confidential or protected by the attorney-client privilege. The Expert above is not your attorney, and the response above is not legal advice. You should not read this response to propose specific action or address specific circumstances, but only to give you a sense of general principles of law that might affect the situation you describe. Application of these general principles to particular circumstances must be done by a lawyer who has spoken with you in confidence, learned all relevant information, and explored various options. Before acting on these general principles, you should hire a lawyer licensed to practice law in the jurisdiction to which your question pertains.
The responses above are from individual Experts, not JustAnswer. The site and services are provided “as is”. To view the verified credential of an Expert, click on the “Verified” symbol in the Expert’s profile. This site is not for emergency questions which should be directed immediately by telephone or in-person to qualified professionals. Please carefully read the Terms of Service (last updated February 8, 2012).