You’re supposed to pick them up on the way out so you’re not swinging around bags of shit all day or leaving a pile on the trail for someone to step in.
I do this if I’m walking somewhere where I know theres nowhere to throw it away. Dog poops at the start of a longer walk, pick it up, place it off to the side somewhere I’m gonna know where it is with minimal impact on other, and I’m gonna know where it is. Then pick it back up when returning. Walking around with a swinging, maybe smelling bag of poo is the opposite of fun.
Its way better to pick it up so no one else walks into it or have another dog eat it. Just place the bag behind or next to a bush so its not in plain sight of others, make a note of its location so you can throw it away afterwards.