I've noticed this problem as well - Cura 4.8 on Linux will add a large retract at the end of the gcode, causing all the filament to be removed from the bowden tube. A little retract is nice, say 3-5mm, but 750mm or 950mm is excessive and leads to the next print failing unless I ensure that the filament is indeed loaded. Since the problem is random, I'm not in the habit of checking each time.
I am using an OctoPi setup. The prints are absolutely flawless, no errors, no corruption, etc. Whoever is suggesting "corrupt bits", etc., sigh. Anyway. This is on a CR-10s running the latest Marlin firmware (2.0.7x).
Here's my ending gcode from the printer settings in Cura:
G91 ;Relative positioning
G1 E-5 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 X Y E ;Disable all steppers but Z
And the last 37 lines of the gcode from the file in case you don't want to download the entire thing:
G0 F9000 X151.851 Y164.366
G1 F1500 X154.608 Y161.609 E952.71868
G0 F9000 X154.425 Y161.096
G0 X155.699 Y160.505
G0 X155.979 Y160.973
G1 F1500 X152.713 Y164.24 E952.91842
;TIME_ELAPSED:8970.640296
G1 F2700 E947.91842
M140 S0
M107
G91 ;Relative positioning
G1 E-5 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G90 ;Absolute positionning
G1 X0 Y300 ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 X Y E ;Disable all steppers but Z
M82 ;absolute extrusion mode
M104 S0
;End of Gcode
;SETTING_3 {"extruder_quality": ["[general]\\nversion = 4\\nname = Standard Qual
;SETTING_3 ity #2\\ndefinition = creality_cr10s\\n\\n[metadata]\\ntype = quality
;SETTING_3 _changes\\nsetting_version = 16\\nquality_type = standard\\nposition
;SETTING_3 = 0\\n\\n[values]\\ninfill_overlap = 50.0\\ninfill_pattern = grid\\nl
;SETTING_3 ine_width = 0.52\\n\\n"], "global_quality": "[general]\\nversion = 4\
;SETTING_3 \nname = Standard Quality #2\\ndefinition = creality_cr10s\\n\\n[meta
;SETTING_3 data]\\ntype = quality_changes\\nsetting_version = 16\\nquality_type
;SETTING_3 = standard\\n\\n[values]\\nsupport_enable = True\\n\\n"}
roller.gcode