If you attempt to execute a Lotus Script agent from the server side script in the XPages and get the following error,
1. Sign the agent, XPage and the associated elements. Better sign the database with the server id.
2. Ensure that you have sufficient access to execute agents
3. Ensure the "Run as Web User" and "Allow Restricted Operation" are selected on the agent
4. Ensure that the type of the agent is "Agent List Selection" with target "None"
Hope this helps :)