ive set up an iron farm, and i have 3 beds next to 3 villagers. Ive tried it in my creative world and the villagers sleep, but in my survival world they do not. There are at most 2 beds in a 200 block range so i dont know why not even one of them are sleeping. They are all farmers, and the composters are right next to them. I also have two unemployed villagers on the ground with a bed each but they dont sleep either.
Please include some screenshots.