Something I think P5 does really well is create truly flawed characters. Not just little quirks that they end up resolving, but actual, realistic character flaws that they have to rely on others to keep in check. Ryuji's impulsiveness is obviously the most glaring example, but you notice it in pretty much everyone. Ann is nice but can be a bit of a whiny person and even a little self centered at times, Yusuke is extremely eloquent but can come off as a bit cold, Futaba is a sheltered girl whose lack of social tact is understandable but still very much a problem at times, Morgana can be condescending in a way that he doesn't seem entirely aware of, etc. etc. It feels very organic, and the team plays off of each other's strengths to fill in the gaps their weaknesses give them.
Persona 4 did something similar, but P5 perfects the idea, or at least realizes it more fully. Even the confidants are like this. Mishima is always willing to help but is way too laser-focused and overbearing, relying on the protagonist to be his straight man of sorts.
Without spoiling anything, the villains in the game show the reverse idea too; that scumbags have traces of redeeming qualities/and or sympathetic motivations for what they've become. For a game with an anime aesthetic, the characters are all surprisingly three dimensional.