ElSapo, I think you're correct that bad trips largely come from what in Buddhism is called
upādāna ("grasping, attachment, clinging"), an idea which is central to the
Four Noble Truths. "Self-doctrine clinging", which is what you're talking about, is one of the subtypes the Buddha identified.
I know at the places where they give people intense, guided psychedelic trips, like research has been done giving psilocybin to terminally ill people to help them reconcile with death, one of the instructions they tell you to repeat and ingrain in your mind is "the same force which takes me into the experience will, of its own accord, bring me back out". People are also instructed that if they see a door, to open it, if they see stairs, to climb them, etc.