From the looks of it, the trigger for YouTube to pause the video is based on the Lock Button.
In my case, I’ve bound the Double Tap feature in accessibility to Lock Screen, and I can use it to have videos playing in the background on YouTube.
I hope it doesn’t get fixed anytime soon, haha.