Detection of collision between elements from same array only works sometimes

No, that’s not the reason. It would just slow things down.

Reason was probably that each circle was compared to each other circle twice. So in case of a collision the changes were made in the if clause but then made again, reversing the values to their old state. Bad.