The bug
Teleporting a mob while it is trying to pathfind to a position will make it try to go in a straight line directly pack to where it was going to, and then continue on as normal if it reaches that spot. If the spot they are pathfinding to is above them they will just jump and spin when they get to the X/Z coordinates. (Image 4)
Video of this happening: https://youtu.be/MSxZZAcP5q4
Somewhat reproducing the bug: https://youtu.be/rKRA9cnjCXk
How to reproduce
Make a new creative world
Spawn a bunch of e.g. creepers
Fly away then type
/tp @e[type=creeper] @s
Watch the mobs carefully as they travel in straight lines to where they were trying to travel to originally.
Or,
Make a new superflat world
Set it to night
Type
/tp @e @p
and watch the mobs carefully
May be related to MC-150839.