I'm so sorry to hear about your boyfriend's mental health.
I actually share a strikingly similar experience, except in your boyfriend's position. My best friend often has to comfort whenever I get worked up over a mistake like even failing to help with school work.
As someone who has suffered from low self-esteem since childhood, the fact that I have someone who is unconditionally supportive and accepting is more than enough. I'm sure your boyfriend is grateful you love and support him unconditionally. Of course during our dark times, we sometimes forget about these things. So don't be afraid to let him know how much you love him! Let him know how much he means to you and that he is already the best! Since we are often so caught up in our flaws, be sure to remind him of his positives and the fact you accept him no matter what. It is also important you let him know you are always there for him and willing to support him.
These things may seem simple but to a person with low self-esteem, such words will mean a lot. By all means, extend yourself beyond these phrases! Kind and affectionate gestures can help him feel more appreciated.
Admittedly, I am even more similar to your boyfriend as I tend to blame myself a lot for mistakes. Just like your boyfriend, I get very emotional and angry with myself to the point I don't listen to reason and become stubborn to change my negative mindset. Once I calmed down, only then do I accept my best friend's comfort. Although this will be very difficult, your boyfriend has to realise it's okay to make mistakes as we are all human and that we can be forgiven.
On the other hand, while support in a relationship is crucial, it is worth considering encouraging your boyfriend to seek a counselor or any form of professional help. Considering your boyfriend has probably had self-esteem for a long time, it might be necessary to seek professional help as changing such cognitive thoughts can be very difficult. This is just something to consider and of course, never stop supporting your boyfriend.
I encourage you to have an open discussion with your boyfriend about his wellbeing, make it clear that you are concerned for him and perhaps even ask what you could do to help.
I'm sorry if this doesn't help for I am not exactly the best at giving advice haha. From someone who suffers from low self-esteem, I hope your boyfriend will get through this and feel happiness for himself! Don't forget to take care of yourself as well!