One of the versions of this is the notorious Mary Roberts Rinehart "Had-I-but-Known" syndrome, in which the narrator, who is the main character usually (most Roberts books are in the first person) at least once in the book starts, "Had I but known what I learned later ..." or something to that effect, which if you did know it, the mystery would be solved.