AI Stuck Jumping On Wall

Hi, for some reason when my AI try to jump up or over a wall, they sometimes get stuck bouncing up and down on the wall and can’t move anywhere, they slide slightly along the wall sometimes too and count as moving, but I want to try and teleport them to a nearby area in the nav mesh if they’re stuck (Unless the sticking problem can be avoided), but I don’t know how to detect if it’s stuck

Here’s the jump function I wrote for the AI