the Fatwa Department Research Committee - chaired by Sheikh `Abd al-Wahhâb al-Turayrî
A judge is not allowed to pass judgment on the basis of his personal knowledge of the case that he may have had prior to the case beong presented to him in court. For instance, it may be that the judge overheard a man divorce his wife. however, if this case is then brought before him in court with the man claiming he did not divorce her, the judge cannot use his prior knowledge to decide the case. he must limit himself to the evidence presented in court. If he feels that he cannot do so under the circumsttances, he should refuse to preside over the case.
Allah’s Messenger (peace be upon him) said: “You come to me with your disputes, and perhaps some of you present your cases more eloquently than others. So, if I give a judgment in his favor because of his testimony and because of it he takes what rightfully belongs to his brother, then I am merely giving to him a piece of the fire of Hell, so he should not take it.”
This hadîth makes it clear that the judge may only use the evidence legally recognized in a court of law, like confession and the testimony of witnesses. He may not pass judgment on the basis of his personal knowledge.
And Allah knows best.
Source: Islam Today