Growing up in a closet, different from the others, with abilities that the adults try hard to pretend do not exist? Believing that you are all alone in the world until you discover that there are many others, far away, in a good place?
Whether or not he gets a boyfriend, Harry’s experiences certainly mirror those of gay children who grow up in a society that insists there are no gay children.
Rupert Grint in the movies). In the 200,000-plus Harry Potter fan-written romances published on The Fanfiction Website, Ron is the most common object of Harry's affection (His nemesis Draco Malfoy is second, Hermione third, and Ginny, his girlfriend in the actual text, a distant fourth).
But the moment Harry discovers that Ron is the person he loves most, Professor McGonagall summons him to her office and tells him, with an uncharacteristic urgency, that he must bring a date “of the opposite sex” to the upcoming Yule Ball. She is very firm about "opposite sex." That is, you may love Ron, but you must not bring him to the Ball. You must not make your relationship known.
In the world of Harry Potter, gay people exist, but they must find lady friends or gentlemen friends, bring an opposite-sex date to every Yule Ball, enter into a screen-marriage, never for an instant let the world know. Harry may have escaped from his closet, but every gay wizard, every gay student, every gay child who reads the books is expected to stay in one forever.
The last scene in the last book of the series, Harry Potter and the Deathly Hallows (2007), depicts all the major characters as adults. Harry has married Ron’s sister Ginny, so they are now brothers-in-law. Isn’t that what they really wanted all along? Meanwhile, Ron has married their other friend, Hermione, and their effeminate antagonist Draco has married an unspecified woman. All loose ends are tied, all connections are made, everyone has turned out to be straight, or at least pretend to be. Rowling concludes: “All was well.”