On electrical issues of this type, I usually check ground connections first- sounds like not enough consistent amp flow. Assume since you replaced the wall switch, a faulty ground would be associated with any heavier wire from the slideout motor to chassis, or a small solenoid to ground wire connection. Also, a pinched wire somewhere with broken fibers could be limiting current flow. And check for tightness/corrosion any related connections in the main 12v. coach electical service bay up front.
I'll have to check my wiring diagram book to see how my one electric slide is configured. Let us know how this turns out and if Loren or Patty assisted.