Adding to above, both for posterity and hoping that someone will pick it up and poke someone internally at Apple :-)
I went jumping through all the hoops necessary (disabling SIP, remounting, clicking through warning messages about insecure setup etc) to modify sandbox-profiles for system services (i.e. those in /System/Library/Sandbox/Profiles/). Adding explicit allow of mach-lookup for com.apple.contactsd.persistence to com.apple.imagent.sb (assuming this should alter the process sandbox for imagent), com.apple.coredatad.sb (Family-process ought to stem from there?) and searchpartyuseragent.sb (for process searchpartyuseragent) alter their behaviour, but the "Family Framework" seems to be in such a bad state without SIP et al enabled I don't really know if it actually fixes the issue.
Anyhow, I want to explicitly note that neither com.apple.imagent.sb, com.apple.coredatad.sb nor searchpartyuseragent.sb seems to include an allow of mach-lookups for com.apple.contactsd.persistence (however, some of them allow lookups to other contacts related mach services directly or through imports, but not com.apple.contactsd.persistence specifically). This means that the sandbox-violations in the OP are to be expected. Therefore it is very weird that Apple-services are asking for that kind of permission. @eskimo Is this intended or a bug? Can you / do you want to poke around internally at Apple a bit? There are several comments in the shared sandbox specification for the messages app / framework (?) (com.apple.iMessage.shared.sb) indicating that the sandbox profile for the messages-framework is a work-in-progress.
Also potentially interesting, these are the events that seem to start the Diagnostics Reporter:
error 18:02:09.385361+0100 ContactsPersistence com.apple.contacts PeopleMessagesAskToBuy persistence Error communicating with persistent store service proxy: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.contactsd.persistence was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.contactsd.persistence was invalidated: failed at lookup with error 159 - Sandbox restriction.}
error 18:02:09.385407+0100 ContactsPersistence com.apple.contacts PeopleMessagesAskToBuy persistence Error connecting to remote endpoint: (null)
error 18:02:09.385441+0100 CoreData com.apple.coredata PeopleMessagesAskToBuy error fault: Unable to create token NSXPCConnection. NSXPCStoreServerEndpointFactory 0x14214d4c0 -newEndpoint returned nil
fault 18:02:09.385482+0100 CoreData com.apple.coredata PeopleMessagesAskToBuy error CoreData: Unable to create token NSXPCConnection. NSXPCStoreServerEndpointFactory 0x14214d4c0 -newEndpoint returned nil
error 18:02:09.385569+0100 CoreData com.apple.coredata PeopleMessagesAskToBuy error error: Failed to create NSXPCConnection
The above log entries show up with the messages app open, and are related to app approvals within the "Family Framework". The approvals don't properly "resolve" on any of my Macs (all arm-based), but show up fine on iOS-devices. See the attached image below:
Not using the messages-app and changing automatic sync of contacts to once per hour seems to alleviate the problem a lot, but not completely.