Gender and sex are not the same thing. Sex is the biological classification of your reproductive organs. Gender is how you identify yourself to society. One should not depend on the other
Gender is the mental construct of your biological sex. People that have a gender other than their biological sex have what is by definition gender dysphoria.