Ok, so what you need to be aware here is that the change in the axis limit settings will only be used by the planner after a queuebuster. This means that during gcode execution the planner will not automatically use the changed limit values as the lookahead may already have finished queueing the gcode for the planner to be ingested.
Since you seem to want to use this when changing tools you may want to remap M6 to include a queuebuster (eg something like 'M66 E0 L0').
I'm not sure if 'M6' already IS a queuebusting operation so you may want to test your setup without actually putting the tool in the spindle during a tool change.