This question was sent to Google Apps Script search tracker as ticket 3478 and was recognized as an error . The ticket remains open, but the following workaround has been proposed :
Denying access to the security settings of your Google account at www.google.com and to the source of Script applications (spreadsheet, etc.).
Change the oAuthServiceName parameter to something else.
Run the script
source share