I'm late to the game on this thread. Don't despair!
My sister-in-law's youngest (girl) would NOT poop in the toilet - ever. She was completely potty trained, to the point of not needing a diaper, except to poop. And she could control her bowels. She was in pre-k at age 4 (half day) so the set up was my niece would go to school in panties and when she got home, my SIL would put her into a diaper, she'd do her deed and they'd swap back to underwear.
Kindergarten was full day, and the school called my SIL to talk about the "situation". They told her they'd have to see the school psychologist, because this wasn't normal. My SIL had tried everything she could think of and she was very frustrated, especially knowing that my niece had bowel control and that it seemed that she was just being willful (she is to this day). She got so frustrated that she grabbed my niece by both shoulders, gave her a little shake and yelled at her that it was time to start using the toilet.
So she did.