The roosting bar needs to be higher than the nesting box. Block off the nesting boxes at night to keep them from sleeping in the boxes. They will foul the nesting boxes. After a while, they will get the message.
Many of my hens slept on the floor until they started laying.
Chris