Somewhere along the line your son has gotten into the mindset of "I can't do anything right. I'm always in trouble. Stupid stupid stupid.." He probably sits in time out focusing on how he has screwed up, yet again...
I was exactly this way as a child. Mine developed into more of a "No one wants to be around me because I'm so horrible" mindset.
Who knows where your son got it from. Perhaps someone, maybe not even you, said "Your a bad boy, go to time out." or "Why do you always _____." This kind of labeling, which is soooooo easy to do, can start the thought process on this negative path. Kids are so sensitive to everything they hear.
As a bit of a warning from an adult survivor of childhood negative self talk; it doesn't go away unless you correct it. Sure as an adult I don't sit and think "I'm so stupid I cant do anything" but I do have some heavy anxiety around embarrassing moments where my thougts are along the line of "Why do I always screw something up. I really am just a spaz pretending to be professional..."
Its the same negativity just all grown up.
So after that depressing clip I want to say that - I really like @DadOfTwo 's answer. When you hear him say something like this, casually correct him as if he had just said the wrong answer to a math problem. "Oh actually your behavior isn't you because you can change your behavior at any time. Maybe today you talk really fast but tomorrow you slow down. See you changed your behavior. That's why you can't be a 'Bad Boy', that's just silly."
After that make sure you show him that whats in the past, is in the past. "Remember that vase you broke last month? Not a big deal. Grandma actually bought me this new vase, and I wouldn't have gotten it if I still had the other one."
Feeling closure around events can help re-leave the past experiences of bad behavior so they aren't used as "proof" (in his own mind) of his badness. You can also try listing (or having him list) times where he was really good to help him remember those experiences a bit better.