Dear Anders,
Thank you for your query.
Off-hand, I do not see anything wrong with your code.
I am not aware of any other way to edit elements in a group except temporarily ungrouping them.
I cannot really tell what might be going wrong just by looking at your code.
Exactly how do the elements change position?
Just some of them, or all?
Systematically, or randomly, or what?
I hope this helps.
Best regards,
Jeremy