When attempting to configure Record Declaration Settings for a SharePoint Online site you may encounter the error “Sorry, you don’t have access”, but you have full access to the site. In this situation the error is misleading. Most likely, Custom Scripts are disabled.
To resolve the issue, either enable custom scripts for all sites via the SharePoint Admin Center web interface or enable custom scripts for specific sites via the PowerShell command line interface.