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.
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.