@Timothee-Leblond The absolute extrusion command make the extruder go to the E value so when you have E2 on one line and E0 on the next the extruder retracts 2mm of filament when it executes the second line.
Use G83 to set the extrusion to relative and then the first line will extrude 2mm and the second line will extrude 0mm.