I get this error on multiple WordPress sites I run, when I try paste a YouTube video or use the shortcode [embed]:
This only happens with YouTube. Other media websites such as Vimeo has no problem with the embed.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
This may be due to a failed network request from the server to youtube. If the server cannot reach YouTube, the embed will show as "failed to embed" in the editor.
You can fix the problem by allowing the server to make network requests to youtube.
The WordPress Proxy documentation may be helpful, https://developer.wordpress.org/reference/classes/wp_http_proxy/
WordPress core code -