Moving changes the ground, smells and privacy of a toilet spot. A dog can use the new yard for one need and still prefer a familiar walking routine for the other. Do not leave them outside indefinitely hoping they will give in, and do not punish an accident indoors.
First check whether they are passing stool normally on walks. Straining, pain, vomiting, a swollen belly or a much longer gap than usual calls for veterinary advice. If they are well, give them a quiet opportunity in the yard around the time they usually poop. Stay nearby if they are used to you being there, allow sniffing and reward after they finish. The sniff-walk guide supports allowing time to explore, but it does not require the dog to switch toilet locations.
Make sure the new yard is secure and free of hazards. A dog may be distracted by a neighboring dog, unfamiliar surfaces or too little room to move. If a walk is how they reliably toilet now, keep offering one while introducing the yard without pressure. Do not remove their normal option abruptly.
Today, note the dog's usual stool time and offer the yard as an option, not a demand. A healthy dog using the walk is not failing house training.
Sources: Dogs Trust on toilet cues and positive routines, VCA on constipation warning signs, VCA on fear of new places.