I have a question regarding nesting boxes. A lot of coops have them set up so that you can open them from the outside to collect the eggs. This sounds very convenient, but assuming you do NOT want your birds roaming around free how do you keep them from escaping when you open the outside door? I would think if there was a hen laying or sitting on the nest when that door is open it could easily jump up and out, even if only as a reaction to being startled.
We open the collection lid slowly and talk to it softly in case there is a hen still sitting on a nest so we don't spook her. Our hens are too busy concentrating on sitting to be bothered by the door opening slowly.
I have never had this problem.
Like Sylvester said, I usually open the door slowly.
And I think if the birds trust you then they won't be startled by seeing you.
Mine just give me stink eye and I apologize and slowly close the lid

Some people collect eggs from under laying hens no problem but I don't like to disturb mine so I wait.
But anyway, mine never get startled.
Also, it's kind of gross, but if you were going to the bathroom, you couldn't exactly just get up and leave if someone accidentally opened the door, so somewhat same thing for the birds, if they are truly in the middle of laying an egg, they won't just get up and walk off.
Now, I have had a couple birds that weren't really laying yet get bothered and walk out but not usually. And that kind of answers it too, they usually just walk out the pop door rather than flying into danger haha