When you're behind a block and there's a pillager beast in the other side, it will be able to attack you. In fact, when you keep yourself in a closed house or something like that, the beast will still be able to attack you if you're in a wall of the place.
Related issues
duplicates
Comments

Thank you for your report!
However, this issue is a Duplicate of MC-2310.
If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki