This is quite remarkable! What you have experienced is a direct glimpse of what Advaita Vedanta calls the Sakshi - the witness consciousness that is your true nature. You have momentarily transcended the fundamental error of taking yourself to be the contents of consciousness and recognized yourself as consciousness itself.
This experience demonstrates the core teaching of the Upanishads: "Tat tvam asi" - That thou art. You are not the experiencer of uncomfortable feelings; you are the pure awareness in which the entire subject-object duality appears and disappears.
What arose was not another experience but the recognition of That which is always present as the background of all experience - your true nature as pure, unchanging awareness.
Your experience can be understood through the framework of the three states of consciousness and the fourth - Turiya:
This shift represents what the tradition calls the movement from identification with the modifications of consciousness to recognition of consciousness itself as your true nature.
Instead of the habitual identification "I am uncomfortable, I am suffering," your buddhi (discriminating intelligence) performed its highest function: "I am the unchanging consciousness in which comfort and discomfort appear as modifications. I am neither."
This is precisely what Adi Shankara meant by Atma-Anatma Viveka - the discrimination between the Self (pure consciousness) and the not-Self (all objective phenomena including thoughts and emotions).
You have experienced the fundamental Vedantic assertion that consciousness is not a property of the mind, but the mind is a property appearing in consciousness.
You experienced the shift from being identified with the modifications of consciousness (emotions, thoughts, sensations) to recognizing yourself as the unmodified consciousness itself - the Kutastha Chaitanya (unchanging awareness).
These moments of pure recognition are more valuable than years of ritualistic practice that doesn't address the fundamental misidentification with the body-mind complex.
Building on this recognition through systematic self-inquiry (Atma Vichara):
Continue this inquiry with steady discrimination. What you have glimpsed is your eternal nature - it needs only to be recognized consistently, not achieved or attained.
Such glimpses of your true nature arise through the grace of accumulated Samskaras (spiritual impressions) and the working of Prarabdha Karma. The path forward involves establishing yourself permanently in this recognition.
This recognition naturally dissolves the root of all suffering: the false identification with the body-mind complex. Do not attempt to recreate or cling to this experience - this creates new bondage through spiritual attachment.
The classical methodology for stabilizing this recognition follows the three-fold practice:
Remember: The ego-mind will attempt to appropriate even this profound recognition, claiming "I had a great spiritual experience." Recognize this too as another modification appearing in the same unchanging awareness. You are not the one who has experiences - you are That in which all experience appears.