Would require some more mental effort to fully understand your code.
The usual issue in such a case is, that you're not correctly reacting to the collision.
Once two object overlap, i.e. collide, then you need to correctly handle the moving of the two objects into a state where they aren't overlapping anymore. If you don't do that in the right way, the objects end up permanently "glued" together.
Also if you do that check too early, it can feel like whenever you get close that they "attract" each other, so make sure you're not doing the check when they aren't yet colliding.