It’s actually backed by science!
Research suggests that 5-HT2A serotonin receptors play an important role in a flexible thinking since they’re found in the region of the brain responsible for learning and cognition. A study conducted on rats found that when these receptors are blocked, the rats became unable to spontaneously change from one behaviour to another to earn a reward, indicating a decrease in cognitive flexibility.
Psilocybin activates the 5-HT2A serotonin receptors, as its chemical structure is quite similar to serotonin, which explains why so many users experience an increase in cognitive flexibility and a decrease in rigid thought patterns. Lack of cognitive flexibility is often associated with disorders like depression and OCD, so it makes sense that psilocybin is being used to treat these conditions!