While it may or may not have been relevant, he was there under oath and it should have been up to the judge to decide what he has to answer and to compel him if he refused.
I assume the defense wanted to imply he could have had a motive to be the killer? In any event, in effect he answered the question. It wouldn’t be difficult to say “no”.
See my posts where I state that if the judge compels him to testify as to sex... then I was wrong in my opinion... if the judge does not force him to testify about it... then he agrees that in this case, it is not relevant. Either way... it is just an opinion.
LLS