You did it right with a level unit, jacks down.
I had the exact thing happen on my old coachman express except the unit was unlevel, without stabilizers down. The slide went out ok but when I brought it in, it angled towards the ceiling like yours.
I did not suffer any damage but learned to get it level first, with jacks down.
If I was you, I would have a look at the slide mount brackets on the slide exterior wall underneath behind the aluminum trim. Make sure the bolts did not move or the brackets bent.
Has it happened more than once?
2011 Coachman Freedom Express 295RLDS- Sold
2015 F-250 FX4 SUPER DUTY 6.2L Gas 4WD SuperCab XL 3.73 rear / 158" WB / 8' bed. Factory anti-sway and brake controller