You are not your job. You never were. Every single person on this planet has intrinsic worth that has nothing to do with what they do or how they think. You are important regardless of where you have worked.
I often find the most painful employers and experiences are the ones that I gain the most out of in terms of development and growth. Not fun to hear in the moment but afterwards it's a gift.