Why did my object stops colliding when it stops moving while touching the other object?

First most obvious thing is you are guarding against other tags in the first snippet, but not in the second.

Why not print out WHO is exiting the collision? I bet you’ll be surprised.

Also, FYI, photographs of code are not a thing. If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly