"Unlock iPhone to use accessories" message even while attached?

This message is now appearing in iOS 12 when using an audio interface attached to the Lightning to USB adapter. While music plays, there are no issues. However, when I need to pause (using the controls on the lock screen) I can’t resume playback again without unlocking. There have been no disconnects or anything new connected to the port - it’s the same device as seconds earlier, yet the iPhone X can’t recognize this? This worked fine in iOS 11.

Of course I want the protection from random USB devices to kick in when I disconnect the currently attached device, but not while using it. I have not found any settings to control this behaviour either. Also not keen on extending the auto-lock timeout too much.

Is this a bug or a feature?

I am getting this message when I connect my iPhone to either of my computers. I suppose it isn’t that big on an annoyance. How large is the risk of disabling this protection?