In the weeks around a move, meals happen at odd times, the bathroom is full of boxes, favourite books are packed, and the adults are tired and distracted. Routine is the first thing to go, and for a child who poops on routine, that means held poops, which get harder, which makes the next one hurt.
The new bathroom is a stranger. A different toilet height, a louder flush, an echo, no footstool yet, a door that does not close the same way. For a child with any history of fear around pooping, that unfamiliarity is reason enough to hold.
Children also read the adults. If a parent is stressed, short-tempered or simply absent in the move, the child's sense that pooping is safe and unhurried drops. Asking for a diaper, hiding to poop or having accidents are all ways of saying 'this doesn't feel safe yet'.
The good news is that this kind of regression is usually shallow. The skill is still there; it is waiting for the conditions to come back. Putting the routine, the stool and the calm back in place does most of the work.