I was thinking about this earlier this week, because I was actually writing about the role of women in stories.
On one hand, I make an actual point to try and make all of my speaking characters well, characters. One of the things I like about Elmore Leonard (and the show Justified, which is also good at this, even though it's onlu based on his stuff) is the sense that all the characters have lives that occur beyond where we're seeing them in the story.
So the female characters all have a life in my head, at least, beyond where we're seeing the on the page. I think I do a pretty good job of writing strong female characters because I don't really like writing weak characters (that is, in itself, probably a flaw in my writing).
Having said that I am aware that I use the women in refrigerators trope, where the women's function in the plot is to spur the hero into action. This is true in Luther Strode, although Petra has a lot of agency, and if you've read the first issue I posted of The Terror, you'll find it there, too.
But (obviously, since I'm writing this) I'm aware that I'm doing. I'm just not sure how I feel about it. On one hand, I agree with the general notion of using women characters as a props is a bad thing. On the other hand, this is the sort of thing that makes these particular characters tick. Not to mention that at some level, all the characters serve the story.
(On the gripping hand, in Jenny Strange, a male character gets killed in the first six pages for pretty much the same reason, so I'm not at all adverse to stuffing a man in the fridge either.)
So I dunno. It's hard to judge how well or how poorly you do something like this, and if I'm lucky enough for people to care about my work, I guess they'll decide.
I haven't written a lot of gay characters, though. I'm trying to think, and I believe I've only ever written one. I've got two in stuff I have planned (Duel and The Professionals) although in the case of Duel I'm not entirely sure whether anyone but me would know - we'll have to see how that shakes out. It does come up in The Professionals as a plot point, because one of the characters is a bit homophobic and it causes some interpersonal stress.