Axolotls attempt to pathfind towards unreachable water, then start spinning, eventually drying out and dying

How to reproduce:
- Recreate the above setup in minecraft, with no other water sources nearby (can use any solid blocks, I used barriers for visibility)
- Spawn an Axolotl nearby and observe.
This happens even when there are other water sources available, if the axolotl is spawned closer to the inaccessible water source than an accessible one (guy in the the picture is in the process of spinning)

See attached video
The spinning doesn't always happen; when the bottom layer of the water is above the axolotl, it just looks up and doesn't spin