Would that not be really confusing?
Or if you want to do it intentionally, to overlay the two sources, you probably need an app like AudioBus.
But I don’t think it’s functionality the OS should provide as default. It may be useful for your scenario, but for the majority of people it’d be annoying and confusing if YouTube kept playing a video audio when they switched to the music app