When are mine finished laying? I've had some lay just before they go to the roosts though that is rare. So my answer is that I don't know. I can't click your 4 PM button as I've had some lay after that.
Most hens lay in the morning for different reasons. It normally takes somewhere around 25 hours for an egg to go through the hen's internal egg making factory from the time the yolk is released to start the journey until the egg is in the nest. Around 25 hours means it might be less than 24, it might be more than 26. But if you average it out you'll get around 25 if you have a lot of hens.
I've had hens that laid an egg the same time every day. It's more normal for them to gradually get later each day. They are not all identical, it can vary by hen.
There are different triggers that tell a hen when to release the yolk to start the egg on it's internal journey. One trigger is when the previous egg is laid. Another trigger is daylight. To avoid them needing to lay an egg after dark, daylight can trigger them to start that yolk or delay for a day. There are probably other triggers.
Not every hen lays every day either, so the triggers probably key into starting the egg so it will be laid in the morning instead of gradually getting later. That egg laying process can get kind of complicated.
I don't keep my hens locked up until they lay. They generally know to return to the coop when it is time to drop an egg. But not every hen does that, some love to hide eggs from you. When you find a hen not laying in your coop or run, a good way to retrain them is to leave them locked in the coop or coop/run until they lay the egg or just leave them locked up. Usually a week is enough but not always. They can get pretty darn frustrating. It helps if you can find that hidden nest and remove the eggs. Locking them up does not guarantee they will use the nests but at least it is in the coop and/or run.
As long as they are sleeping in the coop, I'd have the nests open well before they start to lay, 16 weeks at the latest. I'd put a fake egg in each nest to show them it's a good place to lay. I use golf balls but those fake wooden or ceramic eggs work great too. Then see where they lay when they start. As long as you have plenty of room and good ventilation you don't have to be in that big of a hurry to let them out in the morning, delaying some letting them out could help, but usually you don't have to do that.
I consider leaving them locked up more of a way to correct a problem as opposed to a preventative measure, but it can help prevent a problem.
Good luck!