Howdy arveejain,
We see that you're having a problem when turning your iPhone in landscape mode where the sound becomes distorted while watching a YouTube video, and we know how inconvenient and concerning that can be.
Have you tried using any other apps to watch a video to see if the sound becomes distorted when flipping to landscape mode? If you haven't, see if you can test that out to determine if that's isolated to the YouTube platform only or not.
If you see that this isn't isolated to when you watch a YouTube video, we'd recommend checking out the following resource as this may be related to the speaker itself that is experiencing the issue.
If you hear no sound or distorted sound from your iPhone, iPad, or iPod touch speaker
Once you've worked through those steps, try watching a video again to see if the distortion remains. If it does, we'd recommend that you Contact Apple Support so they can look into any further details with you, or set up service to have your iPhone inspected.
Cheers!