In 1.17.1, horses summoned with the command start out with 53 health. They are immune to the first hit and instead reset to the correct health when hit for any amount of damage.
Steps to repeat and detect/prove.
Make a small pit.
Summon a horse variant (Llama, Mule, etc.) in it.
Execute the command:
"/data get entity @e[type=llama,limit=1,distance=..8] Health"
Observe the health is 53.0.
Hit the horse with a torch.. or a fully enchanted netherite sword... 🙂
Execute the /data command again. Observe the hit points are set to maximum normal.
Subsequent hits damage the horse variant. This can be verified by executing the /data command again after each hit.
Note; It looks like Horses were broken in 1.16 but they are fixed now. We suspect the problem is with the AbstractHorseClass instead of the Horse Class (which is fixed).
Linked issues
Comments

Duplicates MC-178383

That's fine but it doesn't really duplicate the issue since this affects everything based on abstract horses.
That means horses, donkeys, mules, llamas... and anything else I might have forgotten.

Thank you for your report!
We're tracking this issue in MC-178383, so this ticket is being 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.
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:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Would MC-203414 and/or MC-178383, happen to describe your issue?