Movement Direction flipping from 180 to -180 without any action

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.