Is it allowed to change the gender ( female to male or vice versa)?

According to Ayatollah Sistani, if a person undergoes a complete sex change, such that the internal reproductive parts and the external organs all change, and the person is considered fully the new sex they change into in society, such that the people literally view him as being the new sex, and dealing with him as such, then he says it’s not haram.
But he says that this is not how sex changes are done. Usually some changes happen (with the external reproductive parts and some hormones). He says this is not enough