google sheets – openById / openByUrl always returns empty object/null

Using Apps Script services
Custom functions can call certain Apps Script services to perform more complex tasks. For example, a custom function can call the Language service to translate an English phrase into Spanish.

Unlike most other types of Apps Scripts, custom functions never ask users to authorize access to personal data. Consequently, they can only call services that do not have access to personal data