In many ways, Rules is just a wrapper around core Drupal functionality. So while Rules tries to make this core functionality accessible to users who aren't hard-core Drupal programmers, there are of necessity quirks and assumptions inherited from Drupal that govern and explain how Rules behaves.
Specifically, in this case, the "After saving new content" event is just a way to access the core Drupal hook_node_insert()
function. (Rules creates events for ALL the entity CRUD hooks). So if you want to understand how the "After saving new content" event works you need to understand how hook_node_insert()
works. I don't know if this is explicitly described in the Rules documentation, but it's in the Drupal API documentation: https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_insert/7.x
function hook_node_insert
7.x node.api.php hook_node_insert($node)
Respond to creation of a new node.
This hook is invoked from node_save() after the database query that will insert the node into the node table is scheduled for execution, after the type-specific hook_insert() is invoked, and after field_attach_insert() is called.
Note that when this hook is invoked, the changes have not yet been written to the database, because a database transaction is still in progress. The transaction is not finalized until the save operation is entirely completed and node_save() goes out of scope. You should not rely on data in the database at this time as it is not updated yet. You should also note that any write/update database queries executed from this hook are also not committed immediately. Check node_save() and db_transaction() for more info.
(emphasis added)
Likewise, "Before saving content" uses the core hook_node_presave()
function, where the documentation says "This hook is invoked from node_save() before the node is saved to the database." But since node_save()
involves a lot of steps you need to be aware of what has been done and what hasn't been done yet at this point in the process.
The entire set of Node API Hooks is documented at https://api.drupal.org/api/drupal/modules%21node%21node.api.php/group/node_api_hooks/7.x
There's always an event that will work for what you need, it just might not be obvious which event that will be. Reading the above hook documentation should help you to figure out why the error occurred and which event would be a better fit for what you're trying to do.