The bug
Attempting to open the inventory of a tamed horse being ridden by another player or entity by right-clicking on it while sneaking plays the hand-swinging animation, despite the fact that its inventory cannot be opened since access to a ridden horse's inventory is restricted to its rider. Furthermore, items with a right-click action such as fishing rods or food cannot be used when looking at a tamed, ridden horse while sneaking as the hand animation will be played instead.
Mules, donkeys, zombie horses and skeleton horses are also affected.
How to reproduce
Summon a tamed horse ridden by an entity:
/summon horse ~ ~ ~ {Tame:1,Passengers:[{id:chicken}]}
Hold a fishing rod in your main hand
Attempt to open the horse's inventory by right-clicking on it while sneaking
→ ❌ The hand-swinging animation is played, even though its inventory cannot be accessed by you, and the fishing rod is not used
Can confirm. This does not just affect horse, It also affects donkeys, mules and skeleton horses. For skeleton horses you may notice that when a skeleton trap spawns. (You can use this command to get a skeleton trap: /summon skeleton_horse ~ ~ ~ {SkeletonTrap:1b} )