Why doe the AFCI immediately trip?
An immediate trip typically points to a short-circuit. Make sure that when you pushed the receptacle into place none of the wires came loose, and that the grounding conductor did not contact the ungrounded (hot) terminal on the receptacle.