
You should enable custom script in both tenant and site level.
1.Enable in the tenant level. Go to SharePoint Online Admin center settings page -> Custom Script section -> Set "Allow users to run custom script on personal site" and "Allow users to run custom script on self-service created sites" options.
2.Enable in the site level. Run following PowerShell.
$AdminSiteURL="https://tenant-Admin.sharepoint.com"
$SiteURL="https://tenant.sharepoint.com/sites/creditpipeline"
Connect-SPOService -Url $AdminSiteURL -Credential (Get-Credential)
Set-SPOSite -Identity $SiteURL -DenyAddAndCustomizePages $False
3.SharePoint Online site -> Click Settings -> Site information -> View all Site settings -> Click SharePoint Designer Setting under Site Collection Administration -> Check Enable SharePoint Designer.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.