At a guess, somebody replaced the shear pin on the gear drive shaft with a Grade 8 bolt, so when the slide encountered too much resistance the motor twisted off its mounts instead of the pin shearing as Power Gear designed it to. But that's water over the dam now, although I would make sure the right shear pin was in place for the next time.
Some of the bedroom slides have direct drive motors,(no shear pin). It would be helpful if you identified the brand & model number of the motor so maybe we could give more specific help.
If this one will replace your existing motor, you are in luck:
https://www.amazon.com/523900-523143...dp/B09G6DWLCH/