I was laid off from a very well paying job and to support my family I had to take up a worse paying job with similar problems to the one you described.
Yes. Ive had dark thoughts sometimes. I dont know the answer. It helps to distance oneself and treat the dark thoughts passively, as in if I wasnt in this situation these ideas would not be coming to me, or something like - these are just thoughts and I acknowledge them and let them pass.
Few of my friends did not have good results with medication.
I am also detached from my job, its only purpose is to make enough money to no longer need doing the job. Today I work to live and see tomorrow and the same thing tomorrow again.
I suggest talking to someone elder and with a more positive outlook on life, not from work. Preferably retired.
In summation- You are not your job friend. Not should it give meaning to your life. Live to fight another day. It helps to detach oneself.