It's often that we associate our identity with the work/job we do. You have gone into the spiral of not being able to make progress and feeling guilty about it and then eventually generalising that feeling to your overall self which makes you feel like this. Would suggest to strongly cut your thoughts of work and sign up for activities outside of job/work life. Maybe start learning a new sport, catchup with some old friends, learn some new instrument, solve a jigsaw puzzle, paint, watch a nice thriller movie, engage your mind in other things and slowly you will get sense of achievement from those things. This will make you feel better and rejuvenated to pursue things on the professional front.