[GTM - Custom Pixel] Blocked a frame with origin null from accessing a cross-origin frame

I’m trying to implement the GTM through Custom Pixel, but there is no way to make GTM detect it.

I’ve inserted the following code:

//Google Tag Manager
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer',"MY-GTM-TAG");
// End Google Tag Manager

But Tag Assistant doesn’t find it. (Google Tag: MY-GTM-TAG not found)

If I take a look into the console, I see the following error:

Uncaught DOMException: Blocked a frame with origin “null” from accessing a cross-origin frame.

What could be wrong?