OK, darling, you are not a failure because it's impossible to be a failure.
You might have failed at one or two things you had to do, but fuck that. Everybody fails at stuff all the time; it's how we learn, right? So, huh, you learned a few things. Not so bad, is it!
Being sleep deprived is horrid and confusing. But, one night at a time, it's all right because everyone has sleepless nights now and again. Don't sweat it. Just make a hot drink and put a film on, or read a book. You may be tired tomorrow, but I guess you'll live :) If you get a chance for a nap later on, take it.
Definitely go back to your doctor. I didn't get on with citalopram; they made me so floaty and weird in the first week, it was a massive struggle to continue. There are loads of different antidepressants to try, and different doses. I had at least six prescriptions before getting to my current one! It's all about your metabolism & finding the good-enough scrip for you. It's not all or nothing. There will be a scrip that helps you cope, so keep going back.
Try asking DH for sympathy. I know it can feel like you've no right to it! Depression is an illness, though. Once you can describe your symptoms to a person who loves you, they find it easier to understand that you need support ... and it isn't all about them, know what I mean?!
Well done on doing CBT! You're finding it hard, so you have a good trainer and are taking it seriously. Five stars! Believe me, it takes some tough thinking - and a lot of self-compassion - but it's worthwhile. Have you thought much about self-compassion? How understanding are you towards yourself? You deserve all your own love, you know. You're worth it.
I'm on here because I'm in a relapse. I'd like to thank you, Ikea, for reminding me where I've come from and that I deserve my own understanding, just as you do :) I'm going to bed now, with a sleeping pill, and will have a nicer sleep for having written to you. Thank you very much :)
Lots of love.