Apple iOS can restrict the access of certain hardware and software to a device while it’s locked. It’s important to prevent USB devices in particular from being able to connect to a locked iPhone or iPad. Open Settings -> FaceID & Passcode (or TouchID & Passcode) and scroll down to make sure USB devices aren’t permitted lock screen access.
09.22.19