Sex is either male of female and does not change.
Gender refers to language.
You are entirely correct.