Can a judge ask any doctor who had come for an expert opinion to stand in the corner for whole day? What legal remedy that doctor has?

Judge has some observations but doctor knows that's not correct.