You're not doing the same thing the tutorial does. Firstly it uses map_to_world(), and secondly, it sets the ray origin exactly at the center of the cell that's above the currently iterated cell. While yours is using map_to_local() and sets the ray origin to the topleft of the cell that's left of the current cell.
I suggest you make a test that cast a ray from the current mouse position, do it in _process() and print out the results each frame as you move the mouse. That way you'll be able to determine if the problem is in the ray coordinates or indeed in the collider setup. You can also draw a ray on any canvas item node or use a 2d line node, so you have a good visual feedback.
In general, if you're not sure what you're doing when following a tutorial, you should copy the tutorial code verbatim, without winging it. At least until the thing starts working as expected.