I feel for you so much and wish I could just jump through my laptop and give you the biggest most reassuring hug.
First, if one of your main objectives at this point relates to having some form of income, I would suggest you research Centrelink. You can contact your Centrelink State Unemployment Office to see if you are eligible for unemployment benefits, if you quit your job. Typically they will not offer financial support but some states do under exceptional circumstances, such as harassment, discrimination and unsafe work conditions. They will offer financial support between jobs. If you are in a state which will offer this, I strongly suggest you resign from your job asap under the guidance of Centrelink. Remember, if your short term goal is to generate income, Centrelink may serve you in getting out of this current toxic environment. You may not need to continue toughing it out at your current place of employment, before finding a new job.
Second, you are definitely not a failure. You have simply failed to thrive in an extremely toxic and abusive environment. When you consider it, most people would fail to do this. We humans are not designed to thrive through constant stress and abuse. Not even machinery is designed to function effectively through constant stress and abuse. Whether it's humans or machinery, both will be worn down over time. You sound somewhat 'worn down' so now it's time for some important maintenance...
Perhaps consider visiting your local trusted GP to discuss your mental health. It sounds like you need to consider some support in this area and understandably so. Mental health is just as important as physical health. The 2 tend to interact to various degrees: Eg. If left unchecked, stress can have an impact on certain aspects of our physical self, such as our nervous system.
hairclip, if you visualise the Centrelink idea and the GP visit as a bridge, they can been seen as things which enable you to cross from one thing to another; a dark place to a much brighter place/future. They are simply resources to be accessed during this incredible challenge of your. These are possible steps that define you as nothing other than resourceful, if you decide to take advantage of them. Take some leave (which you may legally be entitled to under National Employment Standards) and do some research in regard to crossing over into a brighter future.
Take care of yourself hairclip