I have been dealing with this exact problem for the last 6months... DS (3.10) started potty training in jan this year, was doing really well, getting the hang of it all, then suddenly got a tummy bug and messed himself.
This was at the back end of March (pardon the pun ) since then he refuses to poo in the toilet, will sit on it, but will not do anything. I can sit him on it before bed, then put on the nappy and 5/10 mins later, there he goes, poo in nappy.
I literally had the HV round last week and she said that it was normal for all DC to be scared of poos, in all forms, and a tummy bug can just be enough to tip them over the edge.
She says now to reward all poos.. even the accidents in pants [gnawing knuckles emoticon]
So at her suggestion i have drawn up a star chart and he gets a sticker for any poo that he does.. I also said he could be 'flown' upstairs (i.e i carry him super fast up to the loo, he had another dicky tummy last week..)
So the plan is to reward all poos, no matter where they are... then next stage is to 'direct' them to the toilet.. which he knows, and isn't frightened.. HV said something about perhaps putting a nappy on him only for his to do poos in.. but i think he's past that ...we'll see....
Apparently the action of pooing and having it go somewhere, possibly splash them, is what can scare them. A bout of iffy tummy and it kinda compounds it all..
So try the reward all poos approach... I'll update you when and if I have any progress.
No stars today, cos he went to bed early with a cold.. b ut that could mean he'll be 'leaking' tomorrow, so there could be more stars to hand out....
Wishing you all luck, fingers crossed for me too!