Character doesn't grab the ledge properly

Why doesn’t my character grab the ledge properly when he is climbing down. Please watch the video

This detects the wall:

This Detects the height of the ledge:

This is the macro that put all those three variables (WallNormal, WallTraceImpact and LedgeHeight) to make the character attach to the detected location.

This is the code that is called whenever I want him to grab the ledge for climbing down.

Guys, does anyone have any idea? Please help.