Why do we forget what we try to remember? Almost everybody has had an experience where someone asks them what their favorite book is, and they immediately forget every single book they have ever read. This infuriating consequence of attempting to dig into memory is mysterious enough by itself. Why does this happen? Why do our memories suddenly disappear when provoked?

I have searched for this and this, but the results don't provide a direct and suitable enough answer.
What you are describing may be the tip of the tongue (TOT) phenomenon.

There are two major explanations for this: the direct-access view and the inferential view.


The direct-access view: the memory strength is just not strong enough to recall the item, but strong enough to trigger the recall
The inferential view: 


  It claims that TOTs aren't completely based on inaccessible, yet activated targets; rather they arise when the rememberer tries to piece together different clues about the word. Emotional-induced retrieval often causes more TOT experiences than an emotionally neutral retrieval, such as asking where a famous icon was assassinated rather than simply asking the capital city of a state.



The second view is interesting, because frustration is an emotion by definition. So when you are frustrated for not remembering the word, your frustration by itself narrows down your ability to retrieve it. This loop goes on until you yell "fuck it. I quit".

So while emotion plays an important role in memorizing a piece of information, it also may hindrance you to recall it back. But if you can devote a lot of cognitive resource (thinking it hard) without being frustrated, then you can still retrieve it. 

TOT is seemingly a very important topic in memory research.



Sources:  Tip of the tongue, Recall (memory)