Problem found in version 3.2.2 in Windows 10.
I was developing a project and I was having a problem with the movement of enemies that I posed in various ways until one day I decided to activate the collision forms to see what was happening on screen and it turns out that the Raycasts at a certain point and for some strange reason start popping as if they stop detecting collisions, so that's where the problem really was, that the Raycasts stop working.
There's no need to share code because it's not the code, but at some point and for some strange reason, they just stop working.
Here I share some screenshots, first when you start the game, everything is fine, you can see how the Raycasts are in red and work properly.
But as soon as things start to happen on screen, it starts that popping and it doesn't detect collisions anymore.
The ones below are normally not detecting collisions, but notice that the enemies on the top row should detect them and no longer do.
I'm sure it's a Godot bug, I've also posted it on GitHub to report it, in case you're interested: https://github.com/godotengine/godot/issues/40952
But for now, can you think of another way to detect Raycast-like behavior without using Raycast?
EDIT: I found the problem. It's not when anything happens, but one thing in particular: When the ball moves.
The ball is not a RigidBody (I don't like the behaviour of physics very much and it's difficult to adapt it to my tastes) but a KinematicBody that moves with move and collide, I've been looking for and correcting myself if I'm wrong but I've researched and read other people who indicate that when they have a Raycast touching the ground while moving the node with move and slide or move and collide the Raycasts start giving wrong behaviours, that's when I said "it's true! the ball moves with move and collide!"
I just tried a RigidBody and indeed, the fault does not occur. Anyway, it wasn't just about fixing the problem in my project, but about fixing the problem in Godot in general because after that I think I can say that we are actually facing a pretty important problem.
I have also commented it in GitHub where I share the project so that they revise it because now I believe to be able to affirm with total security that it is a problem of the Raycast with move and slide/move and collide.