The core rules of d&d (mechanics but not settings) are available under a free license (it was the Open Gaming License, or OGL, although I have a feeling it’s a different license (Creative Commons , maybe?) now following the backlash from earlier this year when Wizards tried to scrap the OGL and replace it with a worse license)
Pathfinder was originally based on the d&d 3.5e ruleset. I’m not sure how far it has diverged from that, as I’ve played neither. Solasta is based on d&d 5e (the latest version of the rules), but is in a non-d&d setting of their own creation. BG3 is also based on 5e (although less strictly than Solasta), but also has the D&D license, so can use the Forgotten Realms/Sword Coast setting
Personally, I enjoyed Solasta, and think it’s a great representation of combat on 5e. The writing and story aren’t amazing, and it lacks the crazy amount of freedom/choices of BG3, but mechanically, it’s a great implementation of 5e rules.
This might not be exactly what you’re looking for (as it can be a little rogue-like), but it’s a game that when I looked for similar things, led me to Dredge: Sunless Sea
You’re a ship captain trying to survive in Victorian era London, after London was stolen by bats and taken to the shores of the Unterzee, an underground sea filled with some very strange creatures, people and locations. This means exploring and finding new trade routes or ways to survive while uncovering the stories of the islands you find, those of your crew, and the larger world.
There’s a sequel, Sunless Skies, where you command a space going train exploring the heavens. It’s a bit easier and has some good quality of life improvements, but I prefer the setting of Seas.
Solasta is a pretty faithful recreation of dungeons and dragons 5e, although the story/writing is not the best (may have improved in the later dlc, I’ve not gotten around to playing it yet). The combat is fun, though.
Still fairly old, but newer than B&W: From Dust . Replace trainable animals with fluid physics and light hearted songs with didgeridoos, and it’s kind of similar.
DREDGE is great, and does overlap with Sunless Seas in some ways, but is nowhere near as story driven (or weird). That said, it’s a lot easier/more forgiving, and has a simpler (and potentially more engaging) main gameplay loop.
I love the Sunless/Fallen London setting, and really wish Seas had some of the improvements of Skies, as I think I prefer the setting of Seas, but I’ve found it hard to go back to, having played Skies.