But his beliefs needn't affect his technical ability to correctly diagnose and treat physical problem.
Most everyday religious etc. beliefs wouldn't. But if his beliefs are as stated, that a demonstrably male person is biologically female, and that biological sex itself is a nebulous concept that can't really be defined, I'd argue that does interfere with his ability to diagnose, for example how would he know to be aware that the signs of a heart attack often differ between the sexes? To prescribe different doses of medications as indicated by sex, and sometimes different medications altogether? To understand the issues of female to male blood transfusions and when that can be problematic?
If they are not his actual beliefs or understanding of sex (which he will have been thoroughly taught in order to have reached the point of being a doctor) then he's lying under oath.