I know guys like that too. I used to see them work out and think the good races they had been running were just freak occurrences and the bubble would burst next time. But the good races kept coming, so I came to expect good races out of them even when they couldn't run for squat in a workout. So if you feel good in the races and they go fine, there's something to be confident about. Just tell yourself, "Even if my workouts have been crappy, I know I can do what I need to do in the race." That doesn't mean totally sandbagging the tough workouts will continue to yield the good race results. You still need to give yourself a chance to improve by working hard when you need to.
As to why you can't find the same level in workouts, perhaps the atmosphere or the imagery of competition is the trigger you need to produce sufficient adrenaline or other neurotransmitters or to call up all the mental signals required to run your best. Some people run much better on relays than in open competition, not only because they get a running start and get to hug the rail a little more as the race spreads out, but because the team depends on them and the competitive drive they feel as individuals is heightened by having four races at stake rather than one. That all adds up to a different set of mental commands, a different sequence of neurotransmitter release, and facilitated access to certain energy sources during the race.
So things could be worse. You could be one of those workout kings who runs 10 seconds a mile slower in races. Even that isn't the end of the world. At least people who run great workouts are in good shape. They just need to find the right races to prove it, to overcome the aversion to competing (or to losing), and to get some confidence. But you already know you can beat people who do the same or better workouts, so racing shouldn't be a source of negative anxiety. You can see it as a chance to show that the other guys might be awesome on Wednesday, but you'll be ahead when it counts.