You need to enable script editing in this modern site,
The command for your reference:
Connect-SPOService -Url https://contoso-admin.sharepoint.com
Set-Sposite -Identity modernsiteUrl -DenyAddAndCustomizePages 0
Here is a video on how to install modern script editor in modern site for your reference:
https://www.youtube.com/watch?v=Fz3NeLLKrpE
If the response is helpful, please click "Accept Answer" and upvote it.
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.