Tell the Truth...

Honestly you don't owe anyone a full and honest explanation of why you're leaving if you're not comfortable sharing it. Anxiety is a personal thing, a health matter, and it's absolutely 100% OK to have boundaries and choose whether to divulge that information in a professional setting. It sounds like your boss is being a bit of a dick about this.

It can sometimes help though, if a workplace is supportive of mental health, as these employers will make accommodations and might be willing to give you some slack.

On the second point, it sounds like anxiety is holding you back from taking opportunities. I'd highly recommend a book called "Feel the fear and do it anyway". You can find a pdf if you search, and even reading the first couple of chapters should give you an insight into how you might be able to proceed.

/r/learnprogramming Thread