This can be caused by collision polygons. If your sprite has an animation playing and each frame has a different polygon or different position of the origin image point - then when animation frame changes, it may collide with the marker/wall, even if the sprite has already turned and started moving away from it. As a result, it immediately turns again and walks through the wall.
The common solution is to use a separate sprite (simple invisible rectangle) for the collision box, and pin your animated sprite to it.
Another option is to add a "cooldown" period. After colliding with the wall, ignore further collisions for this sprite for 0.5 seconds. You can use an instance variable "lastCollision", set it to time expression. And in "On collision" event check that lastCollision<(time-0.5)