Stepcompress check fails if rotation distance is changed at runtime

I am currently working on Kalico and Klippers mixing extruder support.
For this i currently set the rotational distance of every stepper at runtime in order to control the mixing ratio of the mixing extruder.
After switching the rotation distance twice the check_lines() in stepcompress.c in /klippy/chelper fails.
If i disable CHECK_LINES → #define CHECK_LINES 0
Everything works fine.
But i am not familiar enough with the low level code to find the reason for the failure.

Strangely enough, I used SET_E_ROTATION_DISTANCE for a mixing extruder with a reasonable success. I do not recall if I tried setting the rotation distance twice though. That said, are you sure you have not modified Klipper code (e.g. disabled toolhead.flush_step_generation() call prior to setting the rotation distance)? But if no, generally disabling that check is not a good idea, because if the checks there fail, it essentially means that Klipper requires an MCU to execute an invalid sequence of steps, even if at least at that point in time (but you can post the exact error here for evaluation).