Hello Ulrich,
I had gone through ST22 Dump analysis. I 100% agree with your analysis. Because of Duplicate record of /SCWM/QUAN - System is going for Dump/Run-time Error. In this case, It should go for UPDATE statement instead of INSERT statement.
I even searched notes to fix this. I did not find any specific notes for this code. I searched with creteria using /SCWM/QUAN , SCM-EWM-WOP , /SCWM/SAPLHU_TO_UPD . I also gone through lot of notes to identify relevant one But, did not find any right note.
My best suggestion would be dropping a message to SAP and wait for reply.
Regards,
Sathish