I'm very curious if editing the code like you did helped at all.
If I had one guess to explain the error in your image (one I have seen on my printbed several times) it would be this: you broke some (or all like me?) of the blades off of the extruder fan and your extruder has a metal gear?
So here's the idea, if the filament conducts heat up from the extruder barrel and to the extruder-gear area it will make it easier for the gear to "cut" or "strip" the filament, rather than pushing the filament forward.
This issue is compounded by
A clogged/partially clogged nozzle
Wet Filament
A weakened or misshapen extruder tension spring (pushes the filament against the extruder gear with a wheel)
Once the filament starts to strip, the torn peices of plastic fill the extruder's gearteeth, which make further stripping more likely.