Mr. Holmes
(2015)

The case that Holmes (Ian Mckellen) is trying to remember is the case he tried to forget.

The case was about a women who miscarried twice and the only solace she found was through music. Holmes discovered that she wanted to kill herself and tried to talk her out of it by logic. The woman killed herself anyway.

Watson wrote a fictionalized story in which it had a happy ending.

Thanks Michael R!