The solution I've come up with but haven't yet put into action is to use an ESP device, with some sort of contact switch which sits _in_ the hole where the lock goes and detects whether the lock (bolt?) is physically present.
This solution isn't likely to be pretty, unless it could be shrunk down to fit within the "hole", but I imagine some sort of ribbon coming from the "device" which should ideally look/be sized similar to a door/window sensor, and goes into the opening in the frame; Main concerns for a DIY solution are battery life and longevity of the switch/contact being smashed into by the lock/bolt each time.
EDIT: A sibling comment mentioned reed switches and magnets, which I had considered, but felt would be either too bulky (reed switch plus magnet) or too fragile (do reed switches come in non-glass form?).
Another option is to disassemble a door/window sensor and replace its reed switch with a contact switch, much like you want to do with the ESP.
I'll have to give this a try now you've suggested it, I've got a few spare Zigbee doors sensors, Ring and IKEA so will be interesting to see which is better suited.
Thanks for the suggestion!