union mixes subpaths up and distorts large paths

Originally reported in #5218 (moved)

Steps to reproduce:

What happened?

  • path is distorted. If you look at S.split_stand_singles.svg, you see that the two subpaths are mixed up.
  • See comparison for S_split_stand.svg
  • image.png

What should have happened?

  • No path distortion

Workaround

  • Copy and paste the path into a new document, which should remove the scaling.
    • the attached files has a large scaling factor, hiding the fact that the path is huge (viewbox is 0 0 300000 210000, giving a scaling factor of 1000uu per mm)

Debug info