If that job was hammering your mental health and well being, then I think you did quit for the right reasons. No sense staying at a company like that if it's causing you stress and anxiety and depression. As someone once told me, Your employer is in their business. You're in the business of you. Decide which business is more important. That's what you did IMO.
As for your (now former) manager, they showed their true colours when they said you lacked courage. Should have been more supportive.