Not sure about how it works now since I have YT premium. But before I got it you were able to trick YouTube/ios/ipados into playing videos in the background and PIP by opening YouTube in the browser. Then going full screen and swiping home.
I used this method for at least a year until I bought premium.