Parmandur
Book-Friend, he/him
It is only a "mistake" if those spells used were not necessary to a previous encounter, or otherwise saved some other resource you'd rather have. Sure, if you overkill one goblin with a fireball, that's a preventable mistake. But if you are hard pressed to succeed without them, then using them isn't an error. I mean, you don't gain extra XP for having them left over at the end, or something like that.
It doesn't have to be an absolute given in every fight. I'm saying that if you want to give a fair shot to everyone in your party, you ought to press each type in heir own way from time to time. Yo dont' punish a player for choices, but if you don't push them, they aren't really challenged, now are they?
And really, the creatures live in the world 24/7 (or however many hours in a day, and days in the week-like unit). They have the full knowledge of the types of things there are in the world as you have knowledge of things in our world - they may not know detailed mechanics, but they'll know general behavior. You have to live a pretty sheltered life to not know what a barbarian or a wizard is in most settings. You may not be able to suss out whether the woman in robes waving her hands and muttering is a wizard, sorcerer or warlock, but you know she's going to sling magic at you and be kind of squishy. And the big guy who isn't wearing armor, but roars and comes running at you with melee weapons, if you backpedal a bit, may not be so hot to engage...
Given that the second sentence in the OP notes this is about challenging games, I find this comment rather out of place - yes, being intentionally challenging *IS* a valid assumption in this thread. We are merely discussing how variable that task can be. If the GM is not trying to challenge the players, then how effective one class is compared to another is entirely irrelevant, and you should stop arguing with me about it.
And the slippery slope business is really out of left field. The GM is present to show the players a good time. Sure, in some games, that doesn't mean presenting them with a mechanical challenge. And, as above, in those games, who is better at what is largely irrelevant! But, if the players want a challenge, then ignoring various ways of doing that is not really serving the purpose of their being at the table. And, if the players want a challenge, then failing to give the gamut of ways of challenging them comes up with *exactly* the issue raised here - some characters will seem to shine, because you aren't challenging them!
This is all quite true.
At some point in one of the Happy Fun Hour episodes (binged them recently, kind of a blur), Mearls states that their goal is not to balance around optimized play, both to reward people who know how to and wish to optimize, and not to punish people who play the game non-optimally. It seems to be a strange assumption, in my experience, that people won't get caught up and overextend their resources, such as spell slots or rages. If the game was designed assuming optimal play, it would be rather inaccessible.