Even without technological intervention, we know some kinds of chemical exposure and cancers can alter chromosomes and literally change your X into a Y or vice versa. Or even turn it into a different shape than X or Y. Sometimes it a chromosome just goes missing entirely. Genetics are not always good at following the rules and they can break or perform strange new equations with mistaken values whenever a new cell is made. Organics are messy like that
Chromosomes delete, combine, duplicate, change and/or fuse bits of other chromosomes in unexpected places more than you might expect. It can happen to an embryo a few cells big right through a person's life.
Given the male sex is defined by the presence of any Y chromosome though (if we go by chromosome sex determination alone), if an arm breaks off the 46th chromosome after the embryo is established as XX, that XX foetus can develop as XY. Has it changed sex in the womb since it changed chromosomes? Are they female because they were conceived as XX, or male because they were born XY? It happens.
And if a foetus has Chromosome mosaicism, with both an XX and an XY embryo that fused into one foetus, it can be born with both sets of working genitals. Because they usually determine sex visually, they might only see the XY genitals and classify it as male. But the blood tests will sometimes show XX and sometimes XY, as much as 50% of the time if the fusion happened early. Which sex is that person in that case, and are they only 1 sex?
Are they still male becaude they have a Y if the first implanted embryo with XX chromosomes absorbed a smaller XY embryo, and therefore the final body is mostly XX?
And If a person with mosaicism as an adult surgically removes their XY-typical set/parts of their body including genitals, are they still XY? Even if the XY cells can be removed completely because they're only a small part of the person? Because that can happen too.
It only gets more complicated and uncertain from there, because there are a lot of variables at play when there's loads of organic data manipulation. But weird shit can and does happen for reasons we don't yet understand or know about. Depending on how you define sex and the point of sex determination, it is very likely someone has already changed sex.