Sometimes, we have seen while running some scripts which include saved searches from a particular role, shows some error.
That is because, that role doesn’t have access to saved search.
From Admin Role go to Set up → User/Roles → Manage Roles → Edit Particular Role
Then in the specific role, in Permission → Lists sub tab, select “Perform Search” and add View/Full for its access as shown in figure below and save that role.
Now sign in as that role, and run the script again. You will not get that error again.
Note:Sometimes you may face same type of error where you can’t access some Custom Records. So for custom record add the particular custom record in “Custom Record” sub tab and add access type for it and save that role as mentioned above.