Your limit switch must clear when the actuator doesn't touch it any more. If not, it may be influenced by magnetic fields like a stepper motor moving towards the switch. Increase the pull off until the switch is clear from the actuator and the switch level is HIGH again.I tried to understand why GRBL couldn´t clear X ahis limit switch even though I had a lot of extra pull off distance.
Arduino processors (your RPI has an ATMEGA328) have build in pullup resistors. Your Z-axis works fine that shows extra resistors are not needed.Pull down resistors didn´t help at all
No, all processors will response in a similar way. It is the switch that causes this problem.Is arduino based control electronics especially delicate in this sense
I assume you use high voltage switches (230 V) for these low level signals (as most of us do). If money doesn't matter, you could use low voltage switches. As an alternative, you could use proximity switches like LJ12A3-4-Z / TL-W5MC1 / NJK-5001C / etc. Your RPI controller needs a 5 volt version but most (cheaper) 6..24V versions also work on 5V.