3D printer ends print by sinking in to it and getting stuck I am using cura with M3D entry level printer.

When I print things more than 6-7cm/2.5-3inches, at the end of the print, the hot end sink back into the print then gets stuck as it tries to return to idle position.

Please see the attached photo.  Has anyone had this problem?  Thank you

The last 20 lines of gcode is:

G0 X50.83 Y49.982
G1 F600 X50.541 Y49.975 E4399.62304
G1 X50.268 Y49.985 E4399.62637
G1 X49.999 Y49.999 E4399.63024
G1 X49.73 Y50.012 E4399.6341
G1 X49.457 Y50.023 E4399.63742
G1 X49.168 Y50.016 E4399.63941
G0 F7200 X49.28 Y49.87
;TIME_ELAPSED:6301.614981
G1 F1500 E4393.13941
M107
M104 S0
M140 S0
;Retract the filament
G92 E1
G1 E-1 F300
G28 X0 Y0
M84
M82 ;absolute extrusion mode
M104 S0
;End of Gcode
As can be seen from the G-code file, the head is instructed to travel to x=0, y=0 (G28 X0 Y0 is actually a homing instruction to home the head and label the position with zero X and zero Y). After that it powers off the motors (M84). 

From your picture, it looks like the head digs in the print without moving to the home position, so G28 X0 Y0  is not working (although you mention it tries to move while digging in?!?). That is strange as there is no instruction to lower the head. Please alter G28 to G0 so that it reads:

G0 X0 Y0


(or G1 X0 Y0 which does work and will instruct the head to move). 

The digging into the print could be explained by the weight of the head/carriage that cannot be held when the steppers are not powered anymore (as instructed by M84). When the nozzle is hot, the nozzle will then dig into your print.



Edit:

Now that I see your comment on another answer, your proprietary software may produce different G-code than Cura does, this could imply that your printer does not use a "standard" G-code interpreter or does not implement all G-codes.