For standard size chickens you need at least 12" from the roost to the wall. The roost should be higher up than the nest box, if they are roosting on the top rungs of the ladders it's because it's higher than the coop.
This is the inside of my roost area which is the most secure part of the chicken complex.
View attachment 1840612
When I first built it I based it off of some poor plans on the internet and it seems like most of the information you find on the net is based on being cute but not functional at all. So I had my nest boxes where the near roost is and a bit above it.
I built the feeder you see in this photo and installed it in my run while shortly after that learning about chicken stack up or how high things must be in relation to other things.
View attachment 1840621
So then I built a
roll out nest box and put it in the run so it would be lower than where they roosted at night. Of course I had to move the feeder to make room for the nest box and remove the nest box from the coop...
View attachment 1840623
If you want to read my article on my
coop design errors it may help.
Like my signature says it's Observe, Improvise and Adapt...
JT