From my scattered readings on various detransitioners' support sites I'd say that detransitioning because of the way the person was treated by others is sometimes mentioned, but it is nowhere near a common explanation, and it's often not possible to distinguish between people being transphobic and the particular person not passing as the other sex.
It's the latter of those which comes up a little more often in the form of reality not matching expectations (when the expectations were based on happy YouTube videos by transitioners who look gorgeous).
Some detransition due to health reasons, but the largest number of explanations clearly is that the person realised they were not transgender, after all, but transitioned to avoid dealing with sexual abuse trauma, misogyny, internalised misogyny, misandry, internalised misandry, homophobia and/or internalised homophobia, unrelated mental disorders or borderline personality issues etc.
Couple of males detransitioned because they had assumed life was easier as a (beautiful) woman/girl and found that not to be the case. I am mentioning that only because I found it so shocking, given that they had taken hormones for that reason.
None of this is based on any kind of statistical sampling, but at least gives an idea of how some detransitioners explain their choices.