If that works you can try to isolate it further.
I am more Android guy, so I am not yet familiar with the options. Does the iPad have a power usage app describing what apps/services are using the power? Bluetooth for one to keep the Apple Pencil ready, I suppose.
Yes, I realize alternatives exist, but this works so smoothly on Apple devices.
If logging out of iCloud does NOT fix the problem, you eliminated a bunch of potential issues at once.
I mean, switching to Airplane mode is another thing worth trying.
As is rebooting the phone.
I'm pretty sure the problem would go away with a factory reset. Just like it with old Windows installations, except you had a better change debugging those...
This is all far from ideal.
I configured Control+Command+S as a shortcut to put the computer to sleep. While playing a music video on YouTube, I pressed the shortcut and the music stopped. However, as soon as I moved the mouse or used the keyboard, the video started playing again, even while the computer was supposedly "asleep" (with the lid open or closed).
So, at the end of the day, the best thing for me to do is turn off Wi-Fi and Bluetooth, then use the shortcut to put the device to sleep, and finally close the lid before putting the MBA in my backpack.