link to a project file
Steps:
1)run it
2)move the bottom sprite to a grid cell (for example, (0, 0) cell)
3)delete the last section "System: For each Sprite4..." and reproduce steps 1 and 2
4)compare results
This last section means "replace all the Sprite4 objects with Sprite3 ones without repeating". The previous section "System: For each Sprite4. Sprite4 is not overlapping Sprite2" deletes every Sprite4 object which is not inside the grid.
So some Sprite4 objects are already deleted but the program obviously places extra Sprite3 objects.