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?
2017 Salem Villa Estate 395RET-
2011 Coachmen Freedom Express 295RLDS- Sold
2015 F-250 FX4