raycast bug

I was doing a grid-based movement bahavior, the system is pretty simple, when I press a key a raycast is released if it returns false the object moves to the corresponding direction.
the problem is that raycast is detecting collision with objects that do not exist, the problem started after I created an object in the UI layer.
the problem is not only in this game, I opened one of the examples of flowlab and put the same object in the UI layer and the bug happened again
please fix this.

Works fine for me,
usually something like this fixes itself when you refresh the game/page.