Probably why it's best to stay with same sex or the sex you aren't attracted to therapists
I'm straight and female, but I had this type of transference with a female therapist. I know of others of other sexual orientations who had therapy related transference with a gender they do not usually feel any attraction towards. Sticking with therapists of the same gender isn't actually a way to avoid it.
It's not really something that one has to limit types of therapists to avoid. When I did a PTSD intensive, if people have positive or negative or sexual transference with a therapist, they would intentionally not allow them to switch to another therapist. They saw it as an opportunity to work on the real issues - not just that feelings were transferred, but an opportunity to actually work on those feelings that were stirred up. Many trauma therapists see even negative transference as a good opportunity to do deep therapeutic work.
Some of the techniques used by trauma based equine therapy actually encourages transference to happen, and there is a whole field of trauma therapy that works specifically with traumatic transference using somatic experiencing tools.
Positive, negative, and other forms of transference in therapy don't have to be avoided. They do need to be openly talked about when they happen, but it's not a therapy ending event, or at least it shouldn't be.
Sexual transference is only a bad thing if the client and therapist actually engage in a sexual relationship, and any decent humane therapists of all genders will keep those boundaries to make sure that doesn't happen. (It would be illegal for the therapist to allow any sexual relationship.)
It can feel like a romantic/sexual attraction/desires about the therapist, but it's not really actually about sex, or the gender of the other person, or about the other person, or attraction as people would usually think of it. In the case of the OP, it seems like it's more of a self harm thing too - which goes deeper than gender alone. So no reason to be concerned that someone has picked the wrong gender of therapist and that's why they are experiencing this.
@lostforgottensoul has linked to some great articles about it that would help explain it better.