I've had no luck in getting iron golem to spawn in my undeground iron farm.
The whole farm is right in the middle of a real village, all the villagers are now in the farm and not at the surface.
My spawning area for the golems is 16x16 and is covered at the top
The space between the doors and the wall has direct skylight all around.
I have around 10 villagers on each side of the spawning area, and they are level with my doors. They can breed when I feed them.
I am playing the bedrock edition on switch.
Here are some pictures of it.