Generally speaking, you have to look at the goal first. What do RPG elements need to add to the gameplay? The two formost ones I hear always are longevity/replayvalue paired with personalization.
I feel Smash Brothers Ultimate (yes) does this fairly well. I made a topic about it a while ago.
Basically you have all these spirits to collect (longevity) that allow you to customize your character. Some give minor strength boosts, others very powerful immunities etc. But it never really breaks the game as the mechanic is balanced around abilities versus stats. High-stat spirits tend to not allow bonus abilities, and reverse. Sure, Akuma has huge offensive stats, but Isaac can be equipped with 3 bonusses like immunity to PSI or that you start the fight Giant. It's a fun mechanic.
Regarding action-games. I think Nioh had the right idea originally. Have stats determine nuances and allow you to play to your strengths. But even then, it's a very slippery slope. You want the RPG mechanics to determine playstyle, not to be the difference between a 5 minute slog and a 5 second stomp against a boss - which is a problem present in most Action RPGs these days.
Another system would be Demon's Souls if stats didn't increase damage done, but instead just gave access to higher weapons with different movesets. Then you'd already be pretty darn close I'd say.
I haven't played KH2, but I heard that game is quite good in this regard as well.