I just had the opposite issue, I had locked my iPad screen using the CMD + Control + Q keyboard shortcut and set my iPad aside. I noticed a few minutes later that the keyboard backlight was still on, I let it sit for a couple minutes to see if it would go off and it didn’t. I then unlocked the iPad and locked it again, the backlight still wouldn’t turn off. Finally I removed the iPad from the Magic Keyboard and put it back on, it’s been fine since. Maybe a software issue? I’m on the latest 13.4.5 beta.