I would do two things --
1) When you bring the slide in, make sure you hold the retract switch for 3 seconds before you release, (per HWH recommendations) to make sure the pressure builds up to hold the slide in.
2)If that doesn't work, look at replacing your slide retract/extend solenoids. They replace quickly; my HWH tech replaced both in about 20 minutes.
Either you haven't built up pressure to hold the slide in, or your solenoids are leaking pressure and allowing the slide movement.
That's my 2 cents worth.
Former Owner, 2006 36MDDS
2010 Arctic Fox 22GK Travel Trailer
2007 Toyota Tundra