If he was Gu Tiannuo, he must have been severely affected by the fact that his had mother jumped off a cliff in front of him. Coupled with the shocking and horrifying adventures in the Dark Forest, he probably almost died while trying to escape from the ferocious beasts. Therefore, it was reasonable for him to get amnesia as he must have struggled to survive.
The human brain possesses a self-defense system in the region of the subconscious. It was possible for the central nervous system to activate the protective mechanism and selectively delete a specific part or even all of one's memories when one was severely affected by an extremely horrifying event.
Some might lose all of their memories; some only lose part of their memories; some only continued to have their childhood memories. Various outcomes could occur. Perhaps, Luo Zhanyu was affected by one of those conditions.