The mind worked in mysterious ways sometimes. I couldn’t remember what I’d had for breakfast, but I could recall every single detail of that night.
It's not mysterious. This is literally how the brain saves or doesn't save memories. At its most severe, it is PTSD.