How Do I Process a Horrible Court Trial?

I’m an attorney who practices family law.

I had a 3-day trial this week where the judge yelled at me constantly about the case and the issues we were bringing up.  My client had to undergo a psychological evaluation that was ordered before I got on the case. The psychologist said he is obsessive over little things and can’t connect to people.

She made fun of the evidence I presented and constantly yelled at me about the case. I felt deflated, defeated, and helpless. She has not decided the case. We have to come back because the other attorney wants attorney fees. I don’t want to come back and be humiliated.

How do I process this? How do I look at it? How do I not let it affect me going forward?