You either have air in the lines or a bad hydraulic cylinder that is bypassing (leaking internally). The slide cylinder has two feeds - one for each direction in/out. When you retract the slide, the residual pressure in the cylinder pushing the slide in is what locks the slide in place while traveling. If the cylinder is bypassing, the pressure leaks past the seal to the extend side, eventually equalizes, and the slide is free to move.
If you have air in the lines, normal use will eventually purge the air. If you have a bypassing cylinder, the fix will be to replace the cylinder - an expensive and difficult process unless under warranty.
My trusty RV mechanic "adjusted the" slide and we haven't had any further problem. I thought it might be a hydraulic valve, but it wasn't.
__________________
2015 38RL with MORryde IS, residential fridge, DW, washer and dryer, generator, and slide in slide. 2 A/C, 1 HP and a fireplace. Added 17.5 inch wheels. Follows a 2013 Ram dually diesel with 8' bed and Reese 20K.