3D Raycasts don't always detect Collisions at high distances

How far away are we talking about? For huge worlds, you may need to look into large world coordinates. Alternatively, try performing several consecutive raycasts over a smaller distance each (e.g. limit each raycast’s length to 100 units).