When the CiviCRM cache is cleared, and the first access is from an anonymous user, CiviCRM rebuilds the settings with the permissions of the anonymous user, which causes a fatal "Authorization failed" api4 error.
When the CiviCRM cache is cleared, and the first access is from an anonymous user, CiviCRM rebuilds the settings with the permissions of the anonymous user, which causes a fatal "Authorization failed" api4 error.