Think of I this way.
Pre 3e, DnD had virtually no shared mechanical sub reality. Npcs were in no way designed the same way as pcs. That’s why you had things like ten different kinds of “men” in the monster manual. Npcs had no Dex scores. On and on.
Does that mean that adnd settings had no consistency? That tsr era DnD failed to be consistent? That’s a pretty damning thing to say.
You can extend it even further: there were very clear,
specific ways that PCs-and-allies differed from opponents-and-monsters. Gygax knew this, and occasionally it
did cause effects that weren't in line with this "internally-consistent imagined mechanical sub-reality" thing, because it would be a
ridiculously overpowered benefit to (say) recruit a couple of orcs and suddenly have reliable darkvision with functionally no downsides. That gave him a game design dilemma: Forbid recruiting monsters, or mechanically alter monsters that get recruited so they don't become an overwhelmingly advantageous thing (and thus rampantly exploited by players, becoming a dominant strategy.*)
D&D has always been a negotiation between several different priorities, none of which fits into a clean, uncomplicated hierarchy of fulfillment. When appropriate, increasing internal consistency for the mechanical sub-reality is definitely desirable and ought to be pursued--but there are times where doing so costs too much somewhere else. When appropriate, aesthetically-pleasing design is obviously preferable to kludgy messes, but that definitely shouldn't be prioritized over everything else. When appropriate, concessions in other desirable things in order to produce the right player experience--well-paced, engaging, diverse, climactic, etc.--or to aid the DM in running the game, but plenty of such concessions are too costly for the benefit. Etc.
Setting consistency is more a matter of theme, tone, and chronology. Internally-consistent imagined mechanical sub-reality is more a matter of getting the player to see or feel a symmetry between the abstraction of the game rules and the theoretical physicality of the world it represents. (Personally, I phrase this as "naturalistic reasoning". It's what most hardcore Sim fans desire: being able to apply reasoning
as though one were personally there, with all one's
current intuitions and physics knowledge etc., etc., augmented by the established truths of the fictional world, hence "naturalistic" rather than "realistic" thinking, a world where nature is different but still follows natural laws.)
*Note that the proper term here is a
degenerate dominant strategy, but the last time I used that term in its mathematical sense, I got frowny faces, so...yeah.