[Drupal] An error occured while attempting to process add Content Modal form

When trying to add some content new a pane in Panels in Drupal 5 you may get this message.

In my case it was caused by the Secure Pages module. To fix this add the following line to your Secure Pages configuration under Ignore pages: