Yes, they need to be confined to the coop until they can learn where "home" is. If they had a momma hen to show them how things were done, it would be different, but these are clueless adolescents on their own! Keep them in the coop for a while.
Also, when trying to get chickens to go somewhere, one needs to act like a herding dog. You approach the bird from a direction opposite where you want her to go. If she's calmly walking in the direction that you want her to go, then continue slowly approaching. If she freezes and gets nervous and starts to change directions, freeze, back off, and put pressure on her from another direction. Observe her actions carefully and herd her.
It's often easier with another "herd dog" though when you use your husband or your child, you normally have to bark directions on how the husband/child is to move/not move. Sheesh. You'd think that all humans would know how to be a herd dog.