I agree with Fabian, your program is fine. If your position is off, then the crash is causing something to physically move or deform.
You can do several things.
1. Make things more mechanically robust
2. Try to prevent crashes - use a better approach offset, use sensors or compliant grippers
3. Have an automatic TCP calibration - Leoni is one company that sells a device to do this
Sent from my SM-G930V using Tapatalk