Our Lily who is two years old always poops on the front door rug whenever there is a change around the house. A new puppy, we traveled, I left her longer than usual etc...
Usually she stops after the stress has subsided.
You could try putting her in a crate at night so she will hold it?
Good luck