A.F.
How frustrating for you! I totally understand your concern.
Have you asked her why she doesn't want to poop at school? My childhood friend became absolutely terrified to poop at school after our teacher humiliated her in front of the class and screamed at her, telling her that my friend and the whole class would have to sleep alone in the school if she didn't hurry up and finish pooping.
I am not saying that the teacher is at fault in your situation, AT ALL, but mabey a child may have said something unkind to her about pooping. Even just a comment about smell can make a child so self conscious.
HUGS!!!! I hope your daughter can get past her fear.