Return correct error when deleting a document that does not exist