This happens to me when I start pressing keys before the mantle animation is over--like if I get hasty and start sprinting before I'm done getting over the obstacle. More often than not, I end up on top of the obstacle. I think it might depend at what point during the animation I try doing something else. But in most cases, you just press space and wait for your player to mantle and get to the other side before you push any keys at all.