When accidently attacking a villager/golem, the golems will kill the player, the player would die and they would still be hostile.
The golems stay hostile even after leaving the chunks, saving and exiting and loading back in.
This bug first accured in Bedrock Realms.
Thank you for your report!
We're actually already tracking this issue at MCPE-47012, so I will resolve and link this ticket as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki