MMORPGs put the combat element of table top RPGs on steroids, putting it through thousands of iterations in a short period of time.
The consensus is-- no one wants to be in a group with a tank (or any other role) that is 10-20% worse because they masochistically decided to try to play the class with a race that does not support it. In fact-- if there is a race that is only 5% better at being the class, everyone will only want to play tanks of that race.
Which merely tells me that whatever penalties were put in to counterbalance that creature's bonuses aren't harsh enough.
And, yes, there is a fair bit of difference in that MMORPGs put people through predetermined scenarios that are specifically designed so that only the most optimized possible party can hope to clear it-- after all, there is virtually no penalty but time for dying over and over and over again in the scenario.
And yet D&D is still often played through premade scenarios with predetermined opponents.
True, but one would like to think those scenarios and opponents are designed for an average party rather than a party optimized to the max. A good clue here is to look at the pre-generated characters the adventure gives you (if any), as in theory that's the level of optimization the designers have written the adventure to suit.
By there even being an option for people to choose a race/class combination that just flat out cannot function and would be effectively an entire level or more behind the power curve compared to the level printed on their sheet, is making it so that someone will pick that option. And when someone picks that option, they are not hurting themselves-- they are hurting everyone at the table.
If one takes an MMORPG-like approach.
If, however, players step away from that approach, puts character first with only the most basic nods toward optimizing (e.g. put your best stat in your class' prime req.) and lets the chips fall where they may then there's much less (if any) sense of "hurting the table".
As a result many races are only ever seen as one of a few classes despite the narrative claiming that members of virtually all classes exist as that race-- you just simply never, ever see them because they are substandard, sometimes extraordinarily so. And that can be a particularly stark state of affairs when that class/race combo doesn't even fit the narrative-- I have never seen anyone make a character building post or post about playing a Hobgoblin character that was not a Wizard or Warlock since the Volo's Guide released as their racial stats make it so that they are only a good choice for classes that don't come prepackaged with all desired weapon and armor options.
Well, IMO Hobgoblins shouldn't even be PC-playable, but that's another issue entirely.
That said, if they are to be PCs I personally have no problem whatsoever with forcing them into a little tiny niche as doing so will serve to discourage people from playing them! The only caveat is that if a player intentionally wants to play one it needs to be made clear that either they fall into the niche or they're setting themselves up for a real challenge (and some players groove on the challenge of playing against type, as the underdog).
If you make it so that a race cannot function well as a class, or even just being a subpar option, then you basically erase that race/class option existing in the world at all except as some joke that gets killed within their first few sesions and maybe takes the whole rest of the party with them.
That's MMORPG thinking again, in two ways.
First, even if death doesn't end up happening most players IMO shouldn't have any real expectations of their first character or three lasting any great length of time, be said character good, bad or indifferent in terms of optimization.
Second, that the loss of a single character could that easily lead to the wipeout of the whole party indicates an ongoing threat level far higher than D&D usually presents, and-or a mathematical model that's far too fine-tuned to be of any real use to anyone. Most combats as designed are supposed to be fairly easily winnable by an average group of PCs of the expected level even if they roll like crap for a while; and only very rarely is a combat presented where the PCs are by design supposed to run away or sue for parley instead of fight. (and they usually find a way to win the battle anyway!)
If a party of 5 go into a combat and one PC dies along with all the foes, the party still wins.