Most slide systems I have seen have slide controls to sense when the slide hits the retaining wall inside or outside.
The current draw of motor will be sense by controller and motor will stop.
What your describing could very well cause some real damage to slide interior trim or the outside trim of slide when it recesses into wall.
These are
some of the controllers I am talking about.
If you look on one you will see a small pot that can be adjusted to increase the current to motor, with very small adjustments to bring in the slide so it will be
flush with the sidewall or interior wall.
You may find the controls in a floor cabinet or even outside in compartment or on the chassis frame in water tight housing.
Not sure you have them but controllers will also control slide locks which
diagrams can be found here of both.