You're a bit off there. The idea is that campaigns in general being good or not has nothing to do with the number of races allowed, but rather the skill and effort of the DMs who runs it. It's a highly generalized assertion. It doesn't mean that a given DM will do better with a style they don't prefer to one they do. That would be a specific claim that might not apply. It would be like saying that Stephen King would have been just as accomplished if he had tried to be a mystery writer or a romance novelist. Could he write in a different genre if he chose? Probably. But he clearly has a primary interest in the horror genre, so it's safe to assume he wouldn't do as well forcing himself to write in a genre he didn't like.
To make it even more generalized: People who do well at the thing they like doing do well when doing the thing they like.
Some dm's have a specific setting they want to run - whether it's a published one, one from a novel, one they made up or one they've been running for a while and grown to like. These dm's will want pc's introduced to the game to fit the setting. One way to do this is a curated list of allowed races, or even a single-race game.
Dm's with a setting in mind do have to find a way to explain to players what's
cool about the setting, so the players can choose to lean into that and add to it. If this fails to happen (either because the dm doesn't do it, does it poorly, or because the player's don't listen) they'll get pushback. Or, somehow worse, the players will appear to be following along but totally miss the core themes the dm wanted and the whole thing falls flat because the cool stuff doesn't actually happen because no pc is designed to interact with it.
Some dm's aren't attached to the setting per se. They might have a genre, a type of challenge, or a specific enemy in mind to use, or they might just enjoy running for some other reason that doesn't require specific prep (e.g. they enjoy the challenge of building around the characters and find that makes for more interesting character arcs) These dm's often have specific no-go things like flying races or guns in the setting, but are likely to be flexible on the edges and allow anything rules-legal and not specifically banned.
On the other hands, players have a similar divide: some will come to the table with a character in mind they want to play. and try to tweak it to fit the setting if needed. Other will come with about ten ideas and look for the best one for the setting being used. Some will come with nothing and try to build the character in the spot as the setting is introduced, other players do the bare minimum at character creation and build the character during play.
Some players and dm's will come with a clear idea and try to make it work, compromising on details to make it fit. Others will recognize when ideas won't mesh and will pocket those for another game. Others will not be willing to compromise, and generally cause the table to have less fun. These aren't always different people, even.