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