How can I copy animation from an object while it was attached as a child and then paste that animation to it after detaching it?
If this is for a video production, is of lengthy footage and further animation or constraint(s) are needed for models after the medal presentation, baking and/or the Child-of' constraint could prove troublesome.
or even impractical.

A quite simple and straightforward solution could be to split the project between two Blend files.  The 2nd with a different parent to the 1st.
The video clip above was done that way and required a different parent for the man's hands after he'd presented the medal.
The medal and it's cord also needed a change.  They were parentless in the first but needed the girl for a parent after the presentation.
Both Blend files were rendered out as lossless video and the clips joined later in the Video Sequence Editor.
For this method a straight out parentage using CTL-P,  and for the 2nd file,  ALT-P to remove it would be a much cleaner and trouble-free way to deal with the switch.
IMPORTANT -
The only trick to keep in mind when removing or changing parentage, constraints or physics, is to immediately purge the model(s) of all constraints, physics, and keyframes (clear animation in the Outliner)  --&gt; BEFORE  &lt;--  moving the timeline cursor.