Those aren't actually considered to necessarily be in conflict these days. I think sex assigned at birth or something like that would probably be the relevant medical question.
OP is just being colloquial. But you are correct that there is a difference between sex at birth and gender and the medical system does handle that.