Castle realizes Beckett has been lying to him for nearly a year by claiming she didn't remember the shooting (or his confession of love).
Captain Gates specifically asks Castle to help because of his speed-reading ability and attention to detail when sifting through witness depositions. [S4E19] 47 Seconds
While the FBI focuses on high-profile suspects, Beckett’s team realizes the bomber was a person who "witnessed" the event and played the part of a victim. Character Stakes Castle realizes Beckett has been lying to him