I'm definitely selective about the books with darker themes that I pick up (because if I'm gonna make myself sad or afraid it has to feel worth it, y'know?), but here are a few that I've really ended up liking:
The Luminous Dead by Caitlin Starling - Scifi horror. Main character lands a mysteriously well-paying cave exploration job, ends up at the mercy of the woman who hired her (whose motives and sanity are questionable at best). There's the surface-level horror of being trapped in a dangerous cave combined with the deeper horror of having to forfeit bodily autonomy for money under capitalism. The way the dynamic between Gyre and Em evolves over the course of the story is so juicy! I'd reccomend this to anyone who likes to read about fucked-up, deranged women.
The Spirit Bares its Teeth by Andrew Joseph White - YA horror historical fantasy. Yeah this one's YA but it really does not pull any punches. Main character is an autistic trans guy and aspiring surgeon who can see ghosts, and he gets locked up in a sanitorium. There's quite a bit of medical gore in this book, but told from the perspective of someone who finds that medical gore cool and interesting, so it didn't affect me as badly as I worried it would. The real horror comes from the violence human beings enact upon one another to maintain the status quo.
Under the Whispering Door by TJ Klune - Cozy(?) fantasy. Setting is a teashop for the recently dead, helping them pass on. As such, it deals heavily in themes of grief, loss, and moving on, but is still a lot brighter than some of these other reccomendations. I just really like TJ Klune as an author, all his stuff I've read has really good characterization and whimsy.
I Keep my Exoskeletons to Myself by Marisa Crane - Fantasy. Set in modern day, but anyone charged with a crime gains an extra shadow. Main character lost her wife in childbirth, so her child was given an extra shadow at birth for 'killing' her mom. This one also deals in themes of grief and loss, but also the criminalization of nonconformity and the subjugation of anyone deemed 'criminal.' Not gonna lie, this book made me cry.
Anyways that's just a few I can think of off the top of my head, gotta put my phone down and sleep 'cause I have work in the morning but I reserve the right to come back to this thread and reccomend more books later! Happy reading, hope you enjoy at least some of these reccomendations!