Hmm, that is a puzzler!

If he was urinating outside, it could be a UTI.

If he was going elsewhere, maybe he has some arthritis and can't get in the box. But he gets in fine for pee, just not for poop. Do you have a hood on your box? And when he is crated, is there NO hood? Maybe it is an arthritis issue, and he can stoop over with the hood on?

I can't think of anything else, just now, sorry.