I don’t see why someone who doesn’t have room to free range would keep a bird the size of a peacock. Seems to be just asking for poor health.
Several years ago when I got my first pair of peafowl I free-ranged them after keeping them penned for several months. My peacock ran away the day before Christmas, and my parents didn't have the heart to tell me. The female soon followed. We caught her in someone's backyard but the male was never seen again. Peafowl can be extremely difficult to keep in your backyard. They are perhaps one of the most common birds you will find kept solely as a free-range bird, but that doesn't mean it is easy to do and stress free on yourself. It is especially hard if you aren't retired or you don't work from home. When you are off at work your birds can easily wander too far.
Just recently my green peacock escaped the pen. He was found several doors down and after much help from bystanders I was able to catch him and bring him home. He had wandered very far and even been chased by a dog (I learned of his adventures from the neighborhood). I am not sure if he would have found his way back or not. It is very stressful to have your prized bird missing.
The compromise is my peafowl get to live in a large planted aviary with grass, bamboo, and shrubbery. Fairly often I open all the aviary doors and let them free-range under supervision for at least an hour. During this time I have to herd them around because they will try to wander to the front of the property near a busy highway or somewhere they shouldn't go. When it is time to get them back in the aviary, I can herd them back in through the doorway. One of my peacocks I can tell to go in and he will walk back in without me following him. Sometimes my peacocks walk back in their aviary early and don't come back out even though the door is open. Other times if one seems particularly set on staying out longer, I will make the others go in and spend extra time with the one and perhaps let it wander a bit more.
People will pen peafowl to breed for specific varieties, because of predators, because of proximity to busy highways, etc. Also if your peafowl can hear other peafowl in the distance, they will go wander off to find them. That is what I have been told at least, and I don't doubt they would try that especially a peacock without peahens or a young male being picked on by the flock.