Fully Potty Trained At Home, Won’t Poop At School

My 3 year old (37 months), has been day-time potty trained for a few months now with very few accidents. She pee’s and poop’s at home with little issues. She has been peeing on the potty at school for the last month (she had five teacher changes in from May-August and that really messed with her consistency/trust at school and she regressed slightly, but we’ve been doing good for the last month).

Typically, she poops at night before bed, but recently her schedule changed and she’s been going during the day. At home, there have been no issues, but she’s pooped in her undies twice at school this week, during the day. She tells her teacher immediately after, and we’ve talked to her about how it’s okay to poop in the potty at school. She even reiterated to us that she had an accident and next time she will poop in the potty, but then she had another accident yesterday. Both accidents happened during nap time, she doesn’t nap, and the other kids were sleeping, so I’m not sure if she felt it was weird to get up and go potty when no one else was going? She normally just has quiet time and a busy bag during those hours. (Also, she naps at home, but refuses to do so at school, so another thing. Maybe it’s comfort/trust??)

Has anyone else been through this or have tips to encourage her to poop on the potty at school?

Also, she goes to school M-W, and is home Thursday-Sunday.