When I was a kid I had a pet snake, which we would feed live fish via a water bowl. It would commonly chase fish and bite its own tail and squeeze for a few seconds before realizing what it was doing.
Animals can be pretty stupid about spatial reasoning like that, I assume most animals it shoots its ray at are fleeing / not running around in such a way that it'd ever be in danger of pointing at its own tail with the ray, so it isn't really a thought/instinct it ever learned.