It breaks the principle of "show, don't tell". The DM just tells the player what his character knows. It breaks immersion, doesn't explain how the character knows this information, and doesn't represent any action on the character's part.
No, it doesn't, you just have to describe to the player what they know and how they know it.
Use what you know about the character. Your job is to show them a memory rather than vomiting facts at them. If they're a bookworm type, they saw an illustration in a book. If not, maybe they saw such a creature in a travelling show, or heard tales of it at a bar room where adventurers were exchanging tales, or their nana told them stories, or maybe they encountered one before. This works especially well if they don't start at level one in your campaign, so you can assume they had other adventures.
For each monster, you can tier the info-- in one of the comments on the answers here @Dale M said: "Misremembering can be fun - we met a Shambling Mound and I could remember that lighting did something to them - only after we had healed it several times did we work out that it didn't do anything bad"
So look at your monster. Write a scale of success and failure as to what they recall.
So a bad result or near-but-not-quite success can get you something like this: "You remember overhearing something about lighting and Shambling Mounds in a bar."
Later when you find that it heals the Shambling Mounds, you say to the player
"It's coming back to you now, it was some bard that said something about lighting and Shambling Mounds, that was the night you drank Frogo the Barbarian under the table. It's amazing you remember anything from that night at all. You're kind of proud of yourself, really."
That description is tailor-made for a partier. If they went to, like mage school or something: "This was on a test at mage college, and you remember that the correct answer to the Shambling Mounds question was lighting. But you don't remember what the question was. You were cramming hard that week!"
For various monsters, I like to come up with common misconceptions to throw in if need be. Like that a gelatinous cube can be defeated by throwing salt on it, like a slug or something.
Getting it totally correct can be boring, so I like to add in nonsense details that aren't in the manual that will be correct, like the blood of the Northern variety of whatever creature smelling like bananas or somesuch.
It's illogical when, for example, you fight a werewolf without exploiting its weakness to silver weapons, only for a later skill check to reveal your character is aware of this.
Knowing that a werewolf is weak to silver is different than encountering one, knowing exactly what it is and then recalling that. Say I've never seen a werewolf. Say I've never seen an illustration of one, and I've only ever read a description of one in a book. And even if I have seen an illustration, there's no guarantee that the illustration is accurate. Look at illustrations of crocodiles in Medieval times through the 1500s. Some of the dang things had EARS, others had human-like faces. In the middle of a fight, in my first encounter with such a beast, I might not realize what I am fighting until after the fact. If your players know ahead of the encounter what they will be facing, sure, they get the roll. But if a slavering beastie attacks them, in the moment accessing knowledges might be the furthest thing from their mind. Later when they roll it, they now know for sure what it is, but in the moment, with a creature they have never encountered, they just ran on instinct.
Players all roll for every monster hoping to be given information on its weaknesses and abilities, instead of the characters learning that through the game's mechanics of encounter, investigation and exploration.
Some encounters are relatively rare, and if the player doesn't have specialized knowledge, in the moment they might not know what they are dealing with. I like to give a "first encounter" bump on the DC of any creature they deal with. I also like to look at how distinct each creature is (like an owl bear!) and how widespread (kobolds are so...common!). If they are distinct and common, they get negatives to the DC. If monsters are rare or higher level than say level 5, there's more likely to be misinformation on them. If it's going to slow me down and I don't want to bother with it, I just say, "You get to roll for that in 4 rounds" or "You'll have to withdraw from combat for a round/two rounds/three rounds to study the creature and consider what it might be, because you've never seen one before." If I want them to discover the weakness rather than roll for it--I just don't allow the roll, but I make this RARE. That's because player agency is important to telling the story. Instead, I use the delaying tactic above. If one player has an edge, I might give them the name of the creature, but they have no more than that, and telling the others might prompt a roll. Anyone in direct combat should not have time to academically think, and neither should someone concentrating on slinging spells.
There's something else that I also do with monsters, especially in isolated areas like dungeons, which might help you keep that thrill of discovery/investigation leading to knowledge rather than just rolls. I figure that isolated populations of monsters might have mutated, so for me, the Monster Manual is more of a jumping off point. And what's in the MM is what's generally known. Sometimes I replace an attack with something a little different, or make the creature of a poison variety, or one that excretes something sticky that makes it hard to move. I try to take something away from it so I don't break the difficulty or I take a lower level monster and give it a special ability. Sometimes the strength I give them also gives them a weakness--I drop clues that they are like another creature in some way. Like if I make a tiger or animal that has fey characteristics (because it's been modified by the fay or is one of theirs) it's also going to be weak against cold iron. So there's what's generally true, and in books, but there's a specificity you can add on. This little trick keeps my players from metagaming too hard, and when I mention differences ("The owl bears back home are a dull gray, but these have a red bumpy head like a vulture almost..") the players know that even if they do have knowledge, these creatures aren't standard.