medically speaking, there are very very few (just a handful in the world) cases where it is really difficult to determine a child's gender because of genetic problems.
most people who change gender (or want to) have emotional problems, and having parents who are disappointed about the child's gender (eg. if they always wanted a girl and got a boy) is a very big factor for most.
but if someone has already changed gender, God accepts them as they are and then goes from there.
i am a woman, but have quite a lot of 'masculine' thought patterns. nearly all of my work colleagues are men, and in big groups, i'm the one who picks up the big spider and puts it out. i love reading maps, i hate shopping (unless it's for food), and quite like cars (useful at work). but i don't wear a shirt and tie and go bodybuilding to look like a man, coz God created me as a woman, and my job is to accept this.
i have some 'female' characteristics as well, eg. i love to talk
so we need to accept God's will, he does not make mistakes with our gender, where we are born, or other aspects of our life.
wherever we are, God can take us from there, change our lives and fill us with His light.
may He enlighten us all and those around us.