If you have a large number of query plans in ap_stdout, be sure there is sufficient space to copy them on the system segment before starting the copy. Use sp_spaceused to check the size of sysqueryplans, and sp_helpsegment to check the size of the system segment.
Copying plans also requires space in the transaction log.
sp_copy_all_qplans calls sp_copy_qplan for each plan in the group to be copied. If sp_copy_all_qplans fails at any time due to lack of space or other problems, any plans that were successfully copied remain in the target query plan group.