it also has to do with the placebo effect, along with some trauma too.
proof that it isn't genetic is in Australia they did a study where they took 2 identical twins, with exact genetic information, and one of them was gay, the other straight.
for the placebo effect side, kids learn about being gay at a very young age, causing them to have a chance to believe they are one of them, further enforcing the lie.
if none of what was stated is because it happened, its probably a set of things they have experienced throughout their life up until the point they believe they're gay that are going into their subconscious and shaping the way they think.