Ongoing, well-known issue here for at least a year, maybe two years. It’s a Discourse bug.
There’s a stickied thread in Site Feeback on it:
The workaround that works for me:
- Collapse the Preview portion of the post composition window (done so by clicking on the button that looks like “<<” at the lower right corner of the window)
- Make sure that the YT link is on its own line in your post
- Do not try to add a YT link via editing once you’ve already made your post
- Do not try to edit your post after posting it with the YT link