All of the below will ignore the possibility that this substance is not purely MDMA or that it might be some sort of metabolism problem.
Psychedelics most classically work through a 5-HT2A-mGlu2/3 heterodimer, I suppose if enough serotonin ended up at 2A or glutamate you could get mushroom like visuals. This could be a matter of over density of some type of serotonin etc. in a certain area of the brain. 5-HT2A antagonists block the affects of psychedelics.
Would you say you have any level of HPPD? Something in that range (maybe ever so slightly in the spectrum of schizophrenia but just in a visual-snow/tracers etc. sense) and this could be worsened by MDMA?
People do get various visuals without having ever touched a drug, maybe there is something about your personal brain chemistry that is affected by the increased dopamine/adrenaline which if I am understanding correctly lasts a lot longer than the acute serotonergic effects (Just trying point out the discrepancy of trip lengths maybe not relating to a different substance but if your visuals etc. are more related to dopamine/adrenaline it does explain a bit). Maybe it could happen with just a serotonergic though, serotonin certainly has enough connections with all the different brain cells and the extra stimulation could be "floating around" in the brain for a while after the MDMA is gone.
I suppose experimentation with different drugs might narrow down what pathways this happens through. I mean dopamine is classically associated with hallucinations but MDMA is so freaking complex unfortunately, along with serotonin.
I was also under the impression one of MDMA's "therapeutic effects" is that it helps increase dopamine release long term.
HPPD is still something of a mystery but I wouldn't be surprised if it's on some level related and would just get bad enough to come to the surface with drug use. Does this happen with other dopaminergics/adrenergics? Does anything like it happen when you miss a night of sleep too? (Classically makes HPPD type visuals worse)