I'm always amazed that no matter how much we breed to change the appearance of chickens there are certain behaviors we just can't breed out of our birds. Roosters will always crow, hens will always cackle the eggsong, and both sexes will always roost where they want, how they want, and when they want.
You will always have the loner in some flocks. The low bird (or sick) in the flock who will not be allowed to get close. You will always have the 'ball of chickens' who roost so close some are on each other. This is an evolutionary device which developed to allow the higher ranked birds to survive a predator attack. Of course if a light source is being used it means the chicks are cold.
The OP's pictures makes sense if you are a chicken. These young birds are growing fast and might appreciate a little extra support those rapidly growing bodies need. Or the wall could be providing warmth still lingering from the sun. Or by hiding their heads they are preventing pecking from a dominant bird.
For over 6 months Big Sister refused to roost with her flock mates. She always went to the corner by herself. She never tried to join them. She simply went to 'her' corner and roosted by herself. She was always the more assertive hen, and when challenged she quickly flared to accept the challenge. She never backed down from a challenge, yet I never saw her initiate an attack. However, now the weather is colder she is roosting with the flock. I wonder if she'll go back to roosting alone when the weather turns warm in the spring?
Always amazing how intricate those tiny little brains are. We may never know the exact reason why they do what they do but they are sure fun to watch.