UR5e:About freedrive_mode()

I use the script freedrive_mode() and When I entered freedrive mode, it occasionally cannot maintain current position after stopping applying external force.
Note: I need the robot to enter the free drive when it is subjected to external force, and find that the force sensor will be cleared at the moment the robot enters the freedrive, which may be related to this? Is there a solution?

The previous test was wrong, free drive will not clear the force sensor, the program will clear the force sensor at the moment of starting,but how to ensure that the robot can maintain its attitude under free drive?The weight and center of gravity have been configured accurately