There is different types of Role-Playing games but when you look at them they all share common things.
You need to have:
1- Progression; this is done via leveling and skill trees and perks.
2- Stats should be important; stats boost your damage and defensed making you more powerful. Combat should have big factor on stats.
3- Story and Character role playing; this is done either by branching paths with choice and consequences, or by level party system and doing quests with or for them.
Those are the main points.
RPG can expand on that with deep rpg mechanics, with deep rpg mechanics the games will offer you more tools to roleplay and play out your game, like certain builds, skills, perks, crafting tools, ways to interact and play with the game, different ways to complete quests.
The different types of RPGs are:
1- Open World RPG (tricky since they can be action, but most aren't)
2- Action RPG
3- Isometric RPG (cRPG)
4- JRPG (a subgenre popularized in japan based on adaptions, e.g Dragon Quest, Final Fantasy, Persona and SMT)
I really find this subject to be confusing and really uninteresting to talk about, since it doesn't tell you that much when you hear the game is a RPG, instead it would be better if you know if its stealth, action, open world, fps horror, immersive sim, tactical..etc
Also my knowledge is not really amazing on this subject either, so that's how i personally look at it, take it with grain of salt.
The Codex loves to discuss how everything is not an RPG - except Fallout 2 (and maybe Underrail).
That site is obnoxious, i never participated there, someone once showed it to me and i took a look at the forums and after few minutes i left it, lol. Seemed to be a place full of nostalgia boomers who hate everything new and different.
So which of these would you consider an RPG?
The Witcher
Outer Worlds
Fallout
Horizon
We Happy Few
These are some that kinda fall in and out of what an RPG is.
I would say all of them except Horizon maybe? and never played we happy few.
Horizon has rpg elements but as far as i remember, it doesnt really have all the 3 factors i listed, mainly for story. But i'm not very sure, i found it to be a dull and bland game to be honest so i already forgot most of its story.