This didn’t have anything to do with the raycast, I made a silly mistake forgetting that when you fire a remote from a local script it sends the player as the first argument.
how do you know this returns nil?
Have you tried running the cframe bit alone ands getting its value?