It is a positive that you are trying to reassure him. If this is a self esteem issue then he is benefitting from this interaction even if it seems that he isn't. However children can suffer from mood issues even if very young. His behavior in punishing himself and his verbal statement that he doesn't like himself sounds like he may have more than low self esteem. This does not mean that he has a chemical imbalance. Sometimes children have mood disturbances that start with little triggers and the disturbance can stop the same way. It could be something as little as being bulled or being around children who aren't being nice to him.
He could benefit from having a child therapist so that these feelings are properly addressed. A professional can really identify the source of the problem. Even if this is his school counselor it can be helpful. Don't try to wait it out. Also involve him in activities that promote positive self images. Don't spoil him but encourage activities where he has a positive interaction with other children and promote his own happiness. Promote structure because that will help him maintain his focus.
Consult the counselor about any activities that keep him from having too much time to experience depressed mood. Take action now before it gets bigger. Consult with the therapist about what is common with children and depression and what activities you can do alone
Please press accept; this is the only way I get compensated