The main issue comes from relying on a horizontal raycast for ground detection. That’s always fragile at edges. A cleaner solution would be to use 2 or 3 vertical raycasts pointing downward spaced across the player, or even better, an OverlapBox or OverlapCircle slightly smaller than the collider in width and placed just under the feet. That makes ground detection much more stable without losing the ability to jump at edges.
For the walls, the simplest approach is to separate layers (Ground / Wall) and make sure your ground check only detects the Ground layer.
And for moving platforms, like I mentioned before, you can simply do: player.transform.SetParent(movingPlatform.transform) when grounded on it (and set it back to null when leaving).
It’s a bit overcomplicated, but that’s totally normal at the beginning :D