My 7yo has been playing BotW for a few years now and is playing TotK now. He generally does fine with them, granted I have to do the bosses/ harder puzzles for him lol.
Not sure what you mean by "for a few years" but my friend's 9 year old loved Tangle Tower. Great art, voice acting, detective story and puzzles that are the right amount of challenging!
Just to give and answer I haven't seen: I know they recently released a remastered version of Advanced Wars. Not so much logical thinking, but turn based strategy is a puzzle in its own way. And I loved those games when I was around 8-10 years old!
Initially I missed the text body of the post, and thought "SMT: III Nocturne" is a pretty good game with moral dilemmas and whatnot. Lots of fodder for thinking.
That might not be very appropriate for an eight year old though.
A few years? As In you expect them to play this game for a few years?
I'm not sure what exactly you are asking for, the kinds of games I think of, for 'logical thinking' are to complicated to be engaging for 8 year Olds in my experience of 4 children. They like watching me or their older siblings play them, but when their turn comes around, they would much rather play a 2d platformer or 3d Mario or Kirby game, than something like astroneer.
It'll depend on the kind of puzzles they're in to (if they're in to puzzles at all), but the Picross S series is brilliant. Despite all the great games on the Switch, mine is pretty much a Picross machine that happens to be able to play other games.
I play puzzle games and there are no games in that genre that can last for a few years. (Even with user created contents.)
Any established games that actually can last years if you are into the genre(ie. Factorio, Minecraft, Terraria, or procedural content generation games) have established guides and wiki so eventually you don't really think about doing creative stuff cause there are more effective/efficient ways to scale up.
And for games like Zelda:TotK where you can create many different crazy ways to defeat puzzles, mobs or bosses in the over world(since autobuild or zonai devices are disabled inside the shrine), it has that counter side of having to grind for materials or you need to rely on exploits like item dup to keep the boring side down. And, if you kid doesn't even like lego, then chances are those "crafting" games won't appeal to them.
What I think is best, is that you observe what they liked to do more, and then find games with mechanics they would like and have fun doing. And gradually transition to games with more complex progression or puzzles, before you let them try those really open ended crafting ones.
Most crafting games needs some basic skills to get better, cause the things you need to build relies on the materials you have. So you need to calculate how many certain parts needed to gather before you start building it. That would promote basic math skills and planning. Traditional puzzle games that focus more on logical thinking(ie. Talos Principle, Cogs, Toki Tori, Portal) mostly relies on spatial recognition/sequential order of breaking down tasks required to reach the goal.)
Last but not least, fun is essential to drive learning related skills to progress. There is no like one game to play and suddenly your 8 years old would become future a engineer or scientist. But the stuff he learned while tackle all the obstacles game designer throw at him will help him at problem solving for a long time.
Pokemon requires you to understand type matching, so like water beats fire but fire beats grass type of thing, and there's plenty of numbers to get familiar with.
Toki Tori 2 is a metroidvania that doesn't give you movement upgrades, but instead gates your ability to navigate with knowledge (here's how you interact with this thing in the map to overcome this challenge). The graphics are cutesy, but it is a great game.