Failing a knowledge check doesn't mean your character forgot something. It means they never knew that bit of trivia in the first place. Knowledge checks are mostly a way for players to establish what their characters know without tempting them to metagame or argue with the DM that their gnome wizard from Baldur's Gate should TOTALLY know what that strange mushroom from the Underdark is and what it does because they absolutely read about it in a book off-screen.

It is an abstraction designed so the player doesn't need to sit down and decide every single book the character has ever read before the game starts to know what their character does and does not know.