sex and gender might as well be used interchangably ... but yea, using "your" definition, "sex change" should probably be called gender change. Cause unless you lose the sex organs ur really just a transvestite (another misnomer, people getting transgender and transvestite switched up ... even if you have the hormones to add/remove boobs, its still transvestite unless there is an alteration to the primary sex organs)
By my definition, your sex is what you were phenotypically born as (if you were born an XY female, your still female- just can't ever bear children ... cause you have all the female hormones switched on, simply the sex organs aren't fully functional in a reproductive sense)
And, also by my definition, to change your gender would require the removal of the sexual organs you started with AND a change in outward appearance ... so simple unics or castrated people wouldn't count as a different gender. Unless they went through hormone therapy to grow breasts and such to give the outward appearance of a female .. then they would change their "gender"
But its impossible to change ones sex
You can use it interchangeably if you want to, especially since you aren't, I'm assuming, a biologist, psychologist, or a sociologist (correct me if I'm wrong), and frankly in that case it isn't really a whole big issue. But strictly speaking they aren't the same, and if you were a social scientist mixing the definitions of "gender" and "sex" would be embarrassing indeed. There's a whole gray area about "what is sex", what makes a man, what makes a woman, etc, that gets very complicated in the way you just brought up. As I understand it it's much more of gradient with some people falling in the middle somewhere. There are experts in that subject who would know a heck of a lot more than I.
But I am sure of what a "gender change" would look like. It would probably involve a change of clothes, and not any kind of dramatic surgery. You simply take up the role and mannerisms of the opposite gender. There's a whole big gray area here, but one that is more defined by society and something which I can speak with a little more authority on. I don't really want to bring up specific examples that might offend some forumgoer's sensibilities, but there are people whose "sex" and "gender" are different from one another. In the examples you bring up, you're talking about what defines a man biologically or a woman which is not really my field of expertise.
As I said, I only bring this up because it was mentioned. And I'm just letting you know there is a big difference.