The role of a judge is not to give his own personal opinion on a topic. It's to listen to arguments between two different sides, who each may call upon experts, witnesses, present evidence, and so on. And they will then also argue how the other side's take is invalid or misleading. The role of the judge is to work to objectively determine which side has the law and evidence most on their side.
In cases where a judge is a domain expert, he may well end up even needing to recuse himself as that would generally entail opining on debatable topics one way or the other, which makes him unlikely to be able to effectively perform his role.