What @petlimpet wrote. If the enemy is in the Ingame_Object list, then raycasting from it’s centre will cause a hit with the enemy object because the first point of the raycast (inside the enemy object) is in contact with the enemy object.
To avoid this, you can either do what @petlimpet suggested and make an object group without the enemy object in it, or you start the raycast from outside the collision box of the enemy object.
