Still, restrictions only decrease your options, rp included. Tradeoffs are better, have all your options.
Decreased individual options for each character allow for increased distinctiveness and specific niches. This not only makes each class, or more generally "unit type" in a tactical or strategy game, more memorable, but allows for the formation of tactics or strategies that leverage the strengths, weaknesses and limitations of each class.
If you're going to make the classes almost entirely interchangeable, why even make a class system at all? Just go classless like GURPS! But since Sawyer had to pretend to make a D&D-esque Infinity Engine clone because that's what they promised their Kickstarter backers, we end up with a lot of bloated redundancy rather than the potential elegance of a classless system that wouldn't repeat the same ability 10 times with a different name and visual effect for the sake of pretending that classes matter.
And the tired old jokes about PhD barbs and muscle wizards are pretty silly. A high int barb could be one who gets anatomy and psychology, where to strike and how to scare best. A high might wizard does his cardio every day and can channel more taxing energy levels. And so on.
Muscle wizards are ridiculous. I can identify the wizard at a glance in a BG1 screenshot because he's the nerd in the robes. If he's clad in plate armor with a greatsword alongside the fighter who is similarly equipped, once again why are we even bothering with a class system?
You can (and should) specialize your party members, especially if you are using AI scripts. Classes are not almost entirely interchangeable, some of them have overlap. I would say they don't overlap much more than D&D (like melee, ranged, caster).
What would be a good average case? Chanter. It can do things that priests and wizards can, but there's a cadence to it. You either lean into stronger sustained effects and can't alpha as much or pick shorter weaker chants for faster access to more powerful invocations. Its non-summon magic is generally short range cones, which requires it to be closer to the Frontline with all that entails. In a class fight a party of priests or wizards will nuke a party of chanters or alpha buff/debuff and roll from there.
Besides, every class has a unique base mechanic that other classes can't mirror.
Cipher - needs weapon damage for magic, can only target entities.
Barbarian - goes online in aoe and high-risk situations.
Chanter - chants and invocations, summoner.
Ranger - has pet and best ranged dps.
Priest - alpha caster with support spells.
Wizard - can be nuker, melee, alpha debuffer. Can only buff self.
Monk - needs wounds, high risk.
Paladin - is a paladin, a mix of fighter and priest.
Rogue - is a rogue.
Fighter - is a fighter.
Druid - has shapeshift and a balanced selection of spells. Arguably the most overlapping class.
A rogue is not any more interchangeable with a priest than in D&D.
And you still can have your nerds in robes. But you can also put him in plate if you want, maybe you have a peculiar character in mind to roleplay. Nobody is forcing you. Even a frontline wizard is better in robes, because he will magic armor himself and get a weapon better than a greatsword faster.
Edit - wizards can't wear plate armor is the same line of autism as bikini armor, dexterity for bows and studded leather. Plate armor is not a 50kg pauldron Warcraft monstrosity, it's perfectly wearable by anyone. And the tradeoffs are there.
Plus, in Pillars you can have a conquistadore wizard/priest in a stylish breastplate, with a rapier and a pistol. How cool is that.
Edit edit - and that's not even touching Deadfire multiclassing, hot daym
P. S. - look at Battle Brothers. No classes.
By day 100 most of the players will have a party of guys named "
Olaf TwoHand cleave MAtk90", because the choice is there.
But the prestigious ones will have "No-nose Olaf, the badass Miller", because the choice is there as well