This probably isn't a very PC reply, but if criticism of your performance is affecting your mental health refereeing probably isn't for you. Even the very best of referees will be told that they are wrong, even when they clearly aren't, you just have to put it to the back of your mind.
I for a long time suffered from a lack of confidence, to the extent that if someone told me I'd made a mistake I believed it and beat myself up. My coach battered that out of me, but it still lingered. I can still remember one game, Witham vs Heybridge Swifts, where I sat in the car after completely broken, I couldn't even gather the energy to start the car. I called my coach and he pointed out how silly I was being, I'd perhaps made a couple of mistakes in a football game but no one had died. And that jolted me back to life.
Referees make mistakes, those mistakes should never be affecting that referee's mental health.