https://mathworld.wolfram.com/ScintillatingGridIllusion.html
Fundamentally your brain is interpreting signals coming in from your optic nerves at all times so you're not really 'directly experiencing reality', you're interpreting and processing a stream of data and constructing a map of reality from that data. This is usually all done unconsciously, but what psychedelics do at a mechanistic level is interfere with the neuronal processing of that data. You might get a crossover of memories feeding into the visual stream at some level of processing, hence 'seeing visions', or the sound channel might get mixed with the visual channel ('seeing sounnds and hearing colors').
It's not too surprising that this can have profound effects on people's psychology if they were not expecting or aware of this underlying mechanism. It's a concept in philosophy, as well, I believe it's called 'radical skepticism' or some such, the belief that nothing is real, and is in the same category as the simulation hypothesis, i.e. the belief we are in a Matrix VR world. This could plausibly lead to dissociation from normal goal-oriented behavior and result in full blown mental illness in extreme cases.
Personally, I don't really see the difference between 'base reality' and 'perfect simulation' if there's no scientific method to distinguish between the two. If a flaming angel (or UFO) appears in the sky above me, I'll still try to collect its electomagnetic spectrum. Similarly, most people can recognize when they're under the influence of a drug and when they're completely sober - at least, with experience. A first-time user could definitely get these two confused, with dangerous consequences, hence all the warnings about set and setting, trip-sitters, etc.
Regardless, those with a fragile grasp on reality or who are lacking a solid psychological core self-identity should definitely think twice about taking powerful psychedelics.