You don't need to apologise for feeling down, it sounds like you've had a big disappointment with your job, of course you would feel down about it. You don't need to minimise it by comparing yourself to others ("I know people have much bigger problems").
It sounds like you are very hardworking, to the point of pushing yourself beyond your physical/emotional limits. I think perhaps your strong work ethic and high standards are being used against yourself, your post is all about your perceived shortcomings. However, from an outsiders perspective, it sounds like a hardworking person who was good at their job was unlucky and has been put in a shitty situation (funding issues are real if it was something else they would have said).
Maybe rather than trying to force yourself to "pick yourself up", you need to give yourself a break. Let yourself be sad and disappointed for a while, give yourself permission to be a bit "selfish" and focus on your health. Then you will be in a better position to go after a new job where your capabilities can shine again. All the best x