Did you have a bolt holding the brake disc to the hub? If not, the hub will spin inside the disc and the ABS will go nuts which is what the vibrations will have been. It would detect the pedal is pressed but one corner is still rotating.
The loud rattling noise will have been the parking pawl trying to engage while the drivetrain was still rotating! Probably best not to do that too often