There's a big fat clue there! Try increasing your reward rate when he's around others and see what happens. Given you can't reward so well when you're competing, that's another clue, there.
I too have problems with heeling in the ring. My girl heels beautifully during training, but it's all gone as soon as the judge says "forward". I'm watching this thread with interest for ideas. Sorry I can't offer any myself.