loud bangs and rattles overhead could be the locking pins.
First open roof slightly and put something in the gap to stop it creeping back (cardboard box?) remove headlining 2x t15 screws at rear, now start at rear corner and start pulling it off.
Undo slightly the 6 t bolts on the brackets and try pushing the brackets forward and right on the drivers side and forward and left on passanger side (uk car)
grease the pins and lock a tad.
Now see if it shuts, if not move a few mm backwards and inwards, go for a drive.