What I experienced was a form of dissociation, “an adaptive defense in response to high stress or trauma characterized by memory loss and a sense of disconnection from oneself or one's surroundings.”
Dissociation varies in severity, existing as a spectrum from mild dissociative symptoms to dissociative disorders including dissociative amnesia, depersonalization/derealization disorder, and dissociative identity disorder (previously called multiple personality disorder).