Sounds like magic, not the average bunny in a hat magic but, ritualistic magic or magical thinking, it's based on a few different belifes practiced among varied cultures and cults, secret societys, in different ways and understandings. Study the occult and i'm sure you'll run across magic and perhaps enlightenment in your research, the idea of it is to create the desired relaity and act out the motions to then achive the wanted goal, that's why when performing a ritual it usually involves a special setting of some sort, using loud different voices or shouting, different clothing and theres obviously some sort of practicum to it all, but magic is based on a few different philosophical ideas and beliefs most of which aren't popular to western culture, and oh lordy once/if you start doing researsh in to culture and history and understanding different idea systems of reality things really open up, I highly suggest listenting to some terrence mckenna on youtube spark a fatty relax and soak in the knowledge/philosophical thoughts (I don't know if your into or have looked into hallucinogenic/psychoactive plants or anything but obviously Cannabis which is psychoactive) culture to the human is the same as water is to a fish, your born into a culture and that culture has it's set of boundries it sheds light on things and it demoralizes other things and creates kind of a universal thought process for a society, culture also tends to put boundries on thought and spreading ideas. Language travles through something called a "medium" like television, social media, clothing, posters, even drugs, a medium can be alot of things and it's a major factor on how the laguage is pervieved and understood, so you begin to see how societies operate and why they do in the way they do, you decide for yourself if your culture is doing the right thing for all, including earth, I live in the usa and my opinion is... Well I could write for hours on how f***** up it is.. Though there is some good. So apart from all of this what you just seemed to have was a magical and ontological thought without knowing it, ontology is a branch of philosophy that is the study of understanding what it is to "be" thinking about if a physical object is truly "real" or what is "real" and you stumbled upon that kind of thought while smoking cannabis.(makes me giggle) So in your theory after intake of cannabis which takes action very fast, it shifted your plane of perception creating, in a sense, a different point of view, a different reality, things will have a different vibe or understanding leading to other thoughts, example in your case it made you forgetfull or atleast took your thoughts somewhere else for a bit instantly changing your current reality of "ugh I have a headache" to wherever it took you afterwards, it is indeed a healing ability and cannabis has been in a prolonged spirtual alliance with himanity for almost as far as we see back, different cultures have different ways of healing, western pharmaceutical, putting something inside of you a pill which yes still has its needs for life threatning situatious I think but is unessecary and unatural for regualr use for temporary relief, and in western cultue we normaly think that reality is a fixed thing, espically our reality like our feelings and thoughts and such, but you go to indigenous culturs like amazonian cultures and they have healing ceramonies with ayahuasca and other natrual plants, the ceramonies for healing are for healing the self within, the source of it all, and once you reconnect back to your self and begin to really feel and achive your/an understanding of being, that first the inside has to change in order for the outside to. What it is is basicly a magical ritual in conjunction with a sacraed plant.
The thing is these plants have always been around are much more sophisticated than us AND have actually gone through the process of "becoming"... humans have used them to shift the plane of perception and understanding for millennia, at the base of many beliefs there is usually a plant or a metaphorical story of "knowledge coming from the divine"
This went alot deeper than i expected it to xD and I hope anyone who reads it gains some sort of intrest or resonance of the info and I encourage you to do research yourself on the statements and ideas above and always ask questions.