When two things move to touch one another, you do not know which one will detect the collision.
For instance, say you have two moving entities aligned and going in the same direction, but the front one is slower. Every time the back one moves, it collides with the front one, but when the front one moves, it stops colliding:
A Moves and collides with B:
B moves without colliding with A:
To avoid that, you can make each moving Nodes implement a function, say
on_collision(collision, with), and whenever one collides, they call their own function, and then the one of whoever they collided with:
for i in get_slide_count():
var collision = get_slide_collision(i)
Physics related functions like move_and_... should always be called inside a _physics_process() or a function called inside one.