Honestly the whole mechanic of how the villagers decide to do things seems intrinsically linked to where you are. I feel like they are coded to roughly track to where you are if they're nearby, and more likely to perform an action while on screen, to make it feel like you see them and they are actively doing things more often.
However this just creates an effect where whenever you get near them, you're much more likely to see them stop or start doing something - with the stopping immediately screwing up any pictures you want to take if you walk in on them doing something, and the starting screwing up any terraforming you might be doing because the first step is for them to try to get nearer before changing their action.
I really wish they would patch it so if you open your phone(/the photo/terraforming app) all villagers are locked into their current action. If they're singing or sitting or having a bout of the zoomies, then they keep doing that until you close the app again, and then they can change action.