Movement Direction flipping from 180 to -180 without any action

I’m creating a simple movement animation, everything works fine apart from when I’m moving backwards.

When my player moves backwards it will occasially flip the direction from 180 to -180 or vice versa. This causes my animation blend space to glitch and quickly flip through animations to reach the walk back on the other end of the graph.
I’ve pasted images below to show how I’m calculating speed and direction in my animation BP, i’ve also added my Blend Space screen to show the blend space.

Any help here would be appreciated

I am not really sure what Calculate Direction does but but check how it behaves if it receives near zero velocity.

In my experience such flips happen when you normalize near zero vector. Because of inaccuracy in floating point calculations the vector points either slightly to one side or to the other and when normalized it starts flipping 180 degrees.