No creature can walk pass the sleeping villagers.
Although this does not seem to be a problem, it will cause some villagers to be unable to reach their beds. If the iron golem is thus blocked, it will not be able to attack the monster smoothly
Related issues
Comments

Thank you for your report!
We're actually already tracking this issue under MCPE-45560 so I've requested this report be resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
Please don't forget to use the search feature before submitting a bug to see if it has already been reported. The less time we spend linking duplicates means more time testing and confirming the bugs.
Quick Links:
📓 Issue Guidelines – 💬 Community Support Discord – 📧 Mojang Customer Support – 📖 Game Wiki