How can I make my actor turn clockwise or counterclockwise depending on what's closest?

When I jump at a wall; how can I make my actor turn clockwise or counterclockwise depending on what’s closest, no matter where the wall is facing?

As it is right now the character turns towards the wall when jumping at it, which is what I want, but if he jumps from certain angles when the wall is facing a certain angle he somehow turns counterclockwise into the right position instead of clockwise, which would have been waaay closer.

In the video below you can see what I am talking about; the last rotation there looks really bad.

Here is a screenshot of the blueprint concerning the rotation.