I *think* I have a solution. The non-functionality is by design, as a security measure, to prevent devices plugging in that can hack your phone. I noticed when I plugged it in after it being off overnight, there is a notice that you neeed to use your passcode to authorize the device. If you look in Settings, Face ID & Passcode, you’ll see an Accessories settings that is off. Turning it on, is supposed to modify the way it works. So, you need to see that authorization and put in your passcode, to allow it to work—otherwise somebody who doesn’t have your passcode could hack your phone with a dongle.
So, how do you force it to lock and demand that? SOS mode— on a iPhone, clicking five time rapidly puts it in this mode, which also turns off FaceID, which I don’t use anyway, but the idea is at a security check, you could do this so your phone can’t be unlocked with FaceID by somebody point your phone at you.
but, if your AppleTV is on this doesn’t seem to work, so, you also need to go to Settings>General>Airplay & Handoff, and turn Automatically Airplay to never.
[Edited by Moderator]