You probably have Cura set to absolute extrusion and your end gcode has a retraction in relative extrusion which is causing the extruder to move to a very early absolute position.
The solution is to either add a switch to relative extrusion mode before your retraction in your end gcode, or better yet, switch Cura to use relative extrusion. Search the settings bar.