the following problem: I load the player api as described here: https://developers.google.com/youtube/iframe_api_reference#Getting_Started
Then i get this error message:

I get this error only on some domains. On other domains, it works fine. With the same video and the same iframe snippet.
unfortunately when this error occurs this callback function is never executed: onYouTubeIframeAPIReady
This is the main issue here.
If i wait a couple of seconds and execute the snippet manually:
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
the error message does not appear. But onYouTubeIframeAPIReady is still not executed.
So it must be some kind of timing issue. But the problem never occurred to me before. Any hints on what might be the reason for that or easy workarounds would be appreciated.
Unfortunately, I am not allowed to share the affected domains.