Deleting nodes makes orphan records
Incidentally, I got this error yesterday ;-) And after a bit of searching and looking into the documentation, I found that the cause was the functions which loads entities in Drupal and with the name like something_load(e.g. node_load()). I was using node_load() function to load the node and then delete it using node_delete_multiple().

This error was caused because, I was passing array as an argument to node_load(), by something like user_load(array("...; which is not the right way to do it.
The argument to anything_load() function must be a single id. So, you can search for the _load functions which uses array as an argument in your code.