Poopoo only during sleeping

Fio

My toddler used to do poopoo in the toilet until she had some constipation and had trouble going. She is regular now but only does poopoo when she is sleeping. I think she may be afraid to try it while awake. Any recommendations?