About the experience you described:
It sounds like a temporary personality displacement wherein the elements that maintain your regular conscience and perception of your ego-self are temporarily out of place and in such times you can experience yourself as something more or other than your usual ego self-conscience or perception of individual self.
There are 9 aspects to the human personality:
If these are aligned then the personality will perceive reality in accord with their alignment and the content of aryu.
If they become displaced such as during sleep, dream, death, over-exitement, depression, illness,,,,,or,,,,,spiritual evolution, advanced dispassion, serpent power training to move life force, thereby cleansing obstructions or blockages between elements of the personality, then other and higher visions can ensue.
Alternatively, if such displacements occur during a state wherein the personality is less than healthy either mentally or physically or in terms of having too much negative aryu (content in the unconscious based on previous actions that impel new actions thoughts and feelings) then it is possible that those displacement events (which are positive from a spiritual evolutionary perspective) might lead to negative experiences causing fears or even negative psychotic experiences leading to mental issues up to and including insanity.
Sometimes the personality wants to grow but due to conditioning the person is afraid and stays away from practices like yoga because they may lead to a displacement. But nevertheless the soul may want that but since the person’s mind is not in agreement they hold back but the soul forces the issue so you might have a spontaneous experience that leads to fear due to ignorance that can lead to severe personality disorders like living in denial or fear and becoming a fanatic or fundamentalist about religious matters or political matters, sexuality, race, etc.
Therefore, the best course is to listen to the deeper mind and soul and seek proper guidance in books and in spiritual teachers to guide on the quest and allay unnecessary fears so as to be able to move forward in life.