The bug
The name of the advancement trigger player_hurt_entity suggests that it is triggered when the player damages any entity. Instead it is only triggered when the player hurts a mob.
How to reproduce
Download the attached datapack
and place it in the
datapacksfolder of your worldLoad the world
Hit for example an armor stand or a boat
❌ The advancement is not madeHit for example a pig
✔ The advancement is made
Confirmed, still an issue in 1.21.11