Invalid or nonexistent document when copying an agent.
The reason is that the agent is not a shared agent.
A shared agent is available to all users.
An agent is declared as shared when you first create the agent. There is a tick box under the agent name.
Unfortunately there is no easy way to to convert from shared to non shared. You have to copy all the code out of the agent and create a new agent.