There’s no evidence for that. We don’t know what “makes” a person gay, just like we don’t know what makes someone straight. But, hanging out with people who are open about being LGBT+ could help someone who’s afraid to come out to do so, hence the misconception.