Was reading a furious debate on whether a wizard's metagaming of throwing a fireball at a troll* was really a bad thing, because of the fumbling that would be required to figure out that the troll is vulnerable to fire. (Or dumb luck. Poul Anderson had a character stumble and bring the torch to bear, saving the party from the troll -- the source of all the players' problems -- but even in Three Hearts and Three Lions, it's clearly dumb luck, useful for only limited plotting purposes, such as shocking and terrifying characters with the knowledge they would be dead without dumb luck.)
The reality of it is that whether in a role-playing game world or in a novel world, there would be monsters, with vulnerabilities and strengths that would be more or less common knowledge, much as a vampire's or a werewolf's are in our culture, albeit much more intensively studied by adventurers, OR there would be monsters, which could be immune to, resisting, vulnerable to, or drawing upon damage types, and THAT would be known, and so there would be a whole slew of divination spells that would do nothing except detect such issues. No wizard worth his salt would be ignorant of them, partly because no party would accept a wizard who could not cast such spells.
It's not an either/or. It could be that adventurers would know that the first thing you do is go to the tavern and ask what sort of monsters there are about here. And when sent after a specific one, you interrogate everyone you can so you don't get blindsided by a half-red-dragon troll that's immune to magic. And when in unknown regions, you know you are getting into mysterious areas and need to resort to those spells. Some sorting out of rumors -- and outright lies -- might be necessary as well. And of course, absolutely green characters could know little or nothing in a "common knowledge" world, and blindly believe the few rumors , but that's what you have mentors for -- info-dump.
A tale or two of how a party got blind-sided by a monster that was atypical might be wise foreshadowing in a world where most are predictable. Actually hitting the party with one would be a logical time for the characters to freak out. Even there, a few clues might be wise so it's not complete blind-siding.
But neither players nor readers really like a story of fumbling about in the dark.
*Though, as one person observed, throwing a fireball at a monster is a logical attack without the knowledge that they need fire damage to not regenerate, so was it really metagaming?