Test all of your electrical connections, especially grounds related to the slide motor/switch.
I had a similar situation where the ground used for the slide-out switch was very loose where bolted to the trailer frame, causing sporadic issues when using the slide switch, sometimes it wouldn't work until I moved the trailer and the ground shifted and made a "good" connection.
I love me some land yachting