Ok I give in, I've spent far too long looking at pictures and datasheets of M12 connectors and haven't seen anything like this one. Weird thing about is that it's female yet has a threaded body. Obviously I need to find the matching plug, but if anybody can ID the manufacturer/family then that would be a massive step forwards...
Bloody Keyence, always wanting to sell you 400 euro cables by using oddball connectors!
There is an M12 next to it. Looking at this connector, I don't think this is M12. The thread pitch looks too high and the thread size is larger than on the other connector. And the gender is wrong (oh no, cancelled).
Looks like a GX12 series but reversed.