It will work as long as you don't exceed the array size limit.
I'll try explaining how it works:
Your spell instantiates 6 instances: [1,2,3,4,5,6]
Instance 3 expires: [1,2,3(6),4,5] (6 gets swapped with 3, since 3 is no longer needed)
Your spell instantiates 2 more: [1,2,3(6),4,5,6,7]
Instance 4 expires: [1,2,3(6),4(7),5,6] (7 gets swapped with 4)
Instance 4(7) expires: [1,2,3(6*),4(6),5] (6 gets swapped with 4)
Note: The green 6 is the first swapped data.