The way to reproduce:
Spawn some dolphins on land in a place where water is prohibited (like screenshot 1), and wait until they take damage. You'll get to know that it's a very long time.
Spawn some again, and immediately quit and re-join the game. The dolphins will immediately take damage.