There's a weirdly persistent idea in fandom, but not just there, but you see it a lot of the time when people who are a little too fandom- and Tumblr-brained try to write historical fiction for instance, that your options for depicting LGBTQ+ people in the past are either a) some sort of (not always intentional) AU with the exact same social mores as left-wing America/Western Europe now, people use the same lingo and feel just as free publicly identifying themselves as gay/bi/trans/etc. to strangers as a lot of people in liberal-leaning parts of the world in 2023, etc. or b) everyone is deep in the closest and tortured about their sexualities and has survived really harrowing conversion therapy that broke them forever and just nonstop tragedy.... and that's just. not true. Yes, institutional homophobia and transphobia treated people horribly (and still does in many places) and people had to sneak around more as same-sex sexual activity and gender transgression were often against the law and even where they weren't there were other consequences, but there were plenty of people — including much bigger names than you probably realize — who were fairly open within those circumstances, were comfortable with their sexualities and had active, happy sexual and romantic lives. Sometimes, having enough power and prestige meant you could be fairly "out" even in a society where homosexuality was still illegal (e.g. composer Benjamin Britten and his partner, opera singer Peter Pears, were well known to be a couple even before the UK law against sodomy was repealed in 1967) but also, the opposite was often true: marginalized communities that had different social norms, could be subject to stereotypes about them being more "open" to "sexual transgression" anyway, and were often just completely not on some authorities' radar for this sort of thing (obviously they were for many other things) or at least isolated from "respectable" society, also could give people some sexual freedom that those not on the margins of society didn't have. Even people who survived institutional psychological abuse for their sexualities (which not everyone experienced) did not all respond to that in the same way, and plenty of them were able to process it and go on to have fulfilling sexual and romantic relationships with people of the same gender or transition to some degree in a way that was possible within that society/era (honestly, I will never get why so many people think that suggesting that survivors of any kind of abuse are doomed to a life of tragedy and pain only is a "progressive" message).
I don't think you should have to read history books to write, say, historical AU fanfiction, but I think it's good for the health of LGBTQ+ people — for knowing our community, knowing our history, and knowing our resilience and potential to find happiness even in the darkest of circumstances — to look up some of this stuff. There are various mainstream history books about this, including books like Black on Both Sides that focus on LGBTQ+ people of color and/or trans people, etc. But also, a lot of mainstream, published historical fiction about LGBTQ+ people (especially from the past decade or so) can give you a good sense of how to do this, too, because there's a publishing industry expectation those works be at least somewhat historically accurate/those authors do at least some research on the time period (including for romance and YA and other genre stuff, not just literary fiction) that self-published work and fanfiction obviously doesn't have. Authors of those works will often also link to their sources in the back of the book or on personal websites or Patreons. An increasing number of historical dramas on TV about LGBTQ+ people/topics reflect the complexities of how those people navigated homophobia and transphobia in these time periods and that it didn't always result in everything ending badly for the LGBTQ+ person or same-sex couple in question: for two really good examples that I've talked about before, the new Interview with the Vampire show and the remake of A League of Their Own. The latter especially has a cast of predominantly queer women and transmasc people who reflect the various responses people had to the homophobia of 1940s America — from the more classic tortured-closet-cases to people who were about as open and comfortable as you could be, from those who've survived stuff like conversion therapy to people who've been somewhat more accepted (albeit no one so accepted that it reads wrong for the time period) — in a way that shows really deep awareness of what lesbian and transmasc culture was like in that time and place. It also includes prominent queer women and transmasc people of color and focuses on their lives and how they deal with racism and homophobia and misogyny. Just a really good, well-researched show.... still so mad it got cancelled because of the AMPTP refusing to pay writers and actors fairly.
TL;DR the point is just that your options are not either historical accuracy OR happy endings. You can have both! And especially if you haven't done the reading and research I mentioned above, you should not smugly assume that someone who prefers historical LGBTQ+ stories that are not constant tragedies (or for that matter, criticizes a sad historical gay story for more closely reflecting tropes in whump fanfic than how real human beings reacted to certain kinds of historical homophobia) automatically knows less about LGBTQ+ history than you do, lol. Most of the people I know who know the most about this stuff are people who are well aware that for historical fiction to reflect the reality of queer lives, you need a variety of stories: some tragedy, yes, but also the stories of people who were able to live happy lives away from the authorities, or even in the limelight but with a private life that might've been an open secret. But most of them especially like happy endings. We need happy endings! And they are not inherently unrealistic. You just have to do them right — but that's not nearly as hard as you think it is!