I don't know that locking her in a pen would have helped the situation. If she got out of the pasture in the first place (even accidentally) why wouldn't she try to get out of a pen? Often the girls need to walk a lot to get the calf positioned, laying down, stretching out, getting up etc., it isn't just to torture those of us watching, we see that in our herd, locking them up only stresses them out as they forget about calving and focus on getting out. Having them locked up and watching them every second doesn't guarantee a live calf.
Probably what happened was that she laid down next to the fence then laid flat out on her side, but stuck her head under the fence, when she went to "sit up" her head was on the wrong side and she couldn't get up so after wiggling, struggling kicking etc. she frees herself from the fence and is able to get away. But depending on where the calf was positioned when she got stuck his/her air could have been cut off, even when they are part of the way out if the fluids aren't out of the lungs and the umbilical cord gets pinched they can suffocate. There are so many possibilities you can't kick yourself, if something weird can happen it will, the longer you are "in the business" the more strange things can happen - believe me - we've definitely had our share!!!