I've seen devs that passed a code test and discussion that had this problem. For example, you can interview someone on a good day, when most of their days are bad days.
I don't think there's a magic interview style that prevents this problem. Corrective action and fast firing if necessary have worked for me. And whatever you do, don't impose onerous procedures on all of your devs because one of them screws up on a regular basis!