I’ve loaded your test firmware as recommended, reconnected tool head to Add-on1 port and tested. Gear turns and filament is extruded as expected, despite of the fact that I didn’t calibrate the bed so there was on offset between the nozzle and the bed (which is ok for testing). See video: extruder gear OK after test firmware
After bed calibration (which I did many time before I had the problem) I started printing. I had to adjust Z-offset by 0.05mm and — boom — extruder gear suddenly reversed direction from “forward” to “backwards”. I am trying to reproduce this behaviour with power-off-on cycles to make sure I have the exact initial situation … and: Whenever I adjust the Z-Offset during printing, in the middle of a route, the Z-offset is adjusted at the end of the route. This is the moment when the extruder gear reverses direction.
After aborting the printing process (once again with Gcode from Luban and then from Simplify3D), I “reloaded” the filament (it was unloaded during printing because of the reversed gear direction). Again, the gear turned in the “unload” direction. During “unloading” the gear turned in “unloading direction”. There must be something that makes the gear turn backwards - be it a Z offset change or something random.
However, this does not explain why it sometimes happened without changing the Z-Offset (while I had my fingers off) …
Sorry to say this, but I think the test firmware does not seem to solve the problem.