I see this topic is related to this previous thread.
There seems to be a unit problem as the groups appear to get split correctly with a maximum length of 170 mm, not 20 something. Change that value to meet your requirement.
Anyway, here is a solution. This uses this thread’s idea implemented in a C# component. Prior to that the trick is to sort all these lines along the path - it’s much helpful that your input is correctly defined.