It's definitely not the optimisations (I'm debugging Release configuration), it's most likely the fact that the code is being run under the debugger and it keeps some things (including the connection) stable. I think I've done all I could to pinpoint the culprit, and isolated it to the xpc_connection_create_from_endpoint.
I'm building the whole package outside of XCode, so unfortunately I can't really perform a proper archive.
Why would code signed for deployment behave differently to code signed for development? What kind of difference does it make? And if it was indeed the reason, what could I do to make it work, since I must sign for deployment anyway?