Movement component prediction with variable speed

Hello, I’m using a custom strafe jumping system that does client calculations and then send a variable speed to the server via a Reliable server function, but the problem is that in a situation of lag, the server can’t predict correctly the movements and the client does fake-movements (it goes forward, but the server pushes he back). How can I fix this problem?

Solved overriding ServerMoveHandleClientError in UCharacterMovementComponent.