The bug
Normally, a (tamed) dog's tail will move up when it heals. If a dog has more health than it's supposed to and it heals more, the dog's tail will move in a circle, into itself and back out.
How to reproduce
Get a tamed dog
Give it tons of health with a command, such as:
/effect give @e[type=wolf] health_boost 999999 100 true
Start splashing it with instant heal 2 splash potions
Code analysis
Code analyses by @unknown, @unknown, and @unknown can be found here, here, and here.
Can confirm for 1.16.2