This is, shockingly, a rather common issue with highly driven and intelligent children. For reasons that are unclear, developmentally some children seem to be very guilt and self depreciation based. When anything less than their standard of "excellence" occurs they tend to be very hard on themselves and say self depreciating statements.
Before you go to a child psychiatrist I would highly recommend a child therapist. A psychiatrist will treat this as a biomedical condition and medications are a likely outcome. As best practice is to start with the least restrictive and broadest treatment first. His pediatrician will be able to refer you to a child therapist, one who used both cognitive and behavioral techniques that are age appropriate to help your son and the family reshape his behavior.
A good resource that will help and is available on Amazon.com is: How to Give Your Child a Great Self-Image: Proven Techniques to Build Confidence from Infancy to Adolescence (Plume) by Debora Phillips and Fred Bernstein. This book may help get you started in understanding what is going on with your son.
Be assured that you are doing well. Loving your son is the best thing you can do and seeking help at this point only shows you care very deeply his well being.
I hope this helped,