Subaru's amnesia strikes midway through Light Novel Volume 22. After navigating the Augria Sand Dunes and breaching the Pleiades Watchtower, Subaru enters the Green Room to recuperate alongside his companions. His sudden cognitive fracture happens without warning. He wakes up disoriented, staring blankly at Emilia and Beatrice, completely unable to identify who they are or why he is dressed in traveler's garb.
The architecture of this memory loss is specific. Louis Arneb, the Sin Archbishop of Gluttony representing satiety, intercepted Subaru within the spiritual nexus known as the Hall of Memories. While Gluttony attacks typically wipe someone's existence from the world's collective consciousness, Louis consumed Subaru's "memories" while leaving his "name" untouched in the physical world. The cast remembered him perfectly, but Subaru did not remember them.
Crucially, Nagatsuki chose not to erase his protagonist completely. Subaru retained every memory of modern Japan, his parents, and the mundane life he left behind. What vanished was his entire identity as the hero of the Sanctuary, the knight of Emilia, and the architect of the White Whale's defeat. He was, once again, the frightened shut-in from chapter one.