Actually race is a social construct, like gender so, you're right, it's not different.
If you lived in the American south and were the child of a black slave and white slaveowner, you may well be born with pale skin yet you would indeed be identified as black (the one drop rule) even if you appeared as white.
Gender and sex are different. You can't change your sex, that's true, but you can change your gender. Pronouns, like gender, are social, not biological.
I'm not a gender ideology fanatic - having gone through puberty as a male or a female leads to very different biological outcomes, that's just a fact that can't be ignored. But, for the most part, with some exceptions, how people operate in society can be accommodated by how they identify. These are complex issues as human societies are complex so it's not going to be black and white.
I have a friend who transitioned. i knew him as a woman but he was clearly unhappy in that gender (and I met him first about 25 years ago so before this was accepted as it its today). Is his biological sex female? Of course, no one is denying reality. But he lives as a man and, honestly, it totally suits him. If you met him now, you would probably not even be able to guess. And I don't see why it would be anyone's business to do so (again with some limited exceptions).
the idea that I would insist on using female pronouns to speak to him is just absurd and would be really hurtful. And it doesn't fit to speak about him either, at least not now. In the beginning, it happened unintentionally, including using his previous name too. But now it just fits him, it's not forced. But more than that, why would I hurt him by insisting on misgendering him?