As someone who has experienced similar symptoms before - this sounds like burnout.
When this happened to me, I couldn't touch a computer for half a year.
I can't emphasize this enough: this is dangerous and can have a profound effect on both your mental and physical health. Unfortunately it's also pretty common.
I warmly recommend meditation* which can help you leave your office issues in the office and has had a positive impact on my wellbeing. I also recommend talking about this openly with your new boss - communicate what you're struggling with (and that you love the new work) and your fears.
Here are some things that helped me or other close friends when dealing with these issues:
- Take some time off, you have the right idea - there is nothing problematic about taking time off as long as you're responsible about it and communicate it clearly.
- Keep track of your working hours and work life balance actively and make sure work does not consume your life.
- Get professional help from a therapist. I've been unable to do so unfortunately (though meditation helps) but it might be more accessible to you. Most people I know who work high stress jobs do this and if you can afford it I recommend it.
- Working out has also been a great help, physical activity really helps clearing my head.
- Leaning on friends is/was also very helpful.
It is important that you do not blame yourself or develop a feeling of guilt around this - this happens to a lot more developers than most are willing to admit. It's only when I started doing open source on big projects that I realized how common it is. As a reference I personally know at least 5 other Node.js core collaborators who struggled with this in the past year.
- (I use headspace personally but perhaps there are better alternatives - it's just what works for me)