I think often we confuse the two. Obviously some mechanics support a playstyle better than others but you can do a lot of playstyles with a game like D&D.
Which, depending on the table, can be a good thing and a bad thing.
D&D is often described as a big tent game. It supports a lot of different styles of play. Mostly by only lightly mechanically supporting any styles of play. Yes, it's best for heroic fantasy, with the power curve and survivability and heroic nature and the types of abilities. But mechanically it's a light touch.
Now, we all know we can roleplay without any rules whatsoever. So why do we play D&D? Because we like rules. They give us a shared understanding, they help us understand the type of conflicts and resolutions, they give us expectations and get us on the same page.
And there are game systems that do that so, so much better that D&D, like ridiculously better. But they are aiming at something, so it's a much more narrow game playstyle.
Blades in the Dark is a great example. It's got a very specific setting, basically narrowing the focus to one paranormal^3 pseudo-Victorian city, where you are part of a crew that does crime, and you run short (much shorter than D&D) "heists", though it could be an assassination or whatever, it's still narrow. And mechanically it has absolutely fabulous mechanics that strongly support that playstyle. You would be doing your entire table a disservice trying to use the rules to play a standard-D&D-like campaign, because mechanically it's steering it towards specific, narrow playstyle. And giving a huge amount more mechanical and rule support for that playstyle, at the cost of not fitting other playstyles particularly well.
Again, neither is better, just what the table wants. But playstyle and mechanics being only loosely linked isn't a general statement -- it's true for some game systems, and very not true for other game systems.
Let me give a superhero example:
Hero System, originally Champions back when I started playing back in the 80s, is a superhero game. The system has since been expanded out to be a universal system. You can do lots of different styles of play, and the common chassis - "superheroic world physics" is there, but you can do whatever you want within that. I played over a decade and have super fond memories of it.
Masks: A New Generation is a PbtA (Powered by the Apocalypse) game that is laser focused on teen superteam drama. Mechanically you can't play Justice League or Avengers with it, like really there would be a much of mechanics that didn't make sense like why does every adult have influence over Batman? But if you want to play Young Justice or Teen Titans, you've got a heck of a lot more mechanical support than Hero System. You use the same mechanics trying to deal with Dr. Gorilla kidnapping a busload of schoolchildren or with the Homecoming Queen bulling your bestie at Prom. You can become insecure, or guilty, or whatever, with strongly defined mechanical means, not just "I'll roleplay it". And remember, the reason we play D&D over just roleplay without any rules is because we like having things defined. So if that experience is part of what you want from the game, that's a good thing.
And even more, PbtA games are generally Story Now - they give the GM very specific guidance, and then tell them to get out of the way. They often will show the fronts or tensions or that, but they don't even plan like a D&D DM, and the story unfolds more from what they players choose to do. Which is also a big playstyle change, and again both (neo)traditional prep GM games like D&D and Story Now games both have the people who like them or don't, and each table needs to figure out what their preference is for their next campaign -- and it can (and maybe should) swap after that.
So in my view, D&D being the flagship 2nd favorite game of so many people, should provide the least objectionable mechanics possible because their fans will force fit their playstyle onto flexible mechanics. I think WOTC hasn't always chosen that path.
This makes a lot of sense and I agree with you. WotC (and TSR before) wanted the biggest possible audience, and with their legacy and market dominance, having a big tent game that doesn't support specific playstyles but doesn't get in the way of tables playing in a varity of them works well.