Sorry for your losses!
When layers get used to a light in the coop, they will roost much later than normal.
I used to run a light on a timer well past roosting time, and a lot of the layers would stay out till dark, pushing the envelope all the time. They would get stranded once in awhile, especially during summer, too dark to find the coop door or it had closed already, and just squat and fall asleep next to the coop. When my light finally burned out, I had the same issue you did, chickens trying to roost with no natural light left in the sky. My game chickens are not affected by artificial light in the coop, they will always roost early. I'm not providing a light in the coop anymore, and the layers go to bed much earlier, while they have natural light. I think I prefer the coop unlit, chickens are roosting in a timely manner, less bickering come roost time, everyone gets good rest, and it helps gives my sex-links a break from laying during winter. My auto door is from TSheaby's build, and the actuator moves so slowly, I doubt it could shut on a chicken. Plus, I added a tall 5" lip they have to step over, with a small opening 8x10, so there is no standing in the doorway.