macOS app sometimes freezes when setting GKLocalPlayer authentication handler

Erratic behaviour developing a game on the Mac. I'm using and building for the current (non-beta) version of everything as of this date: macOS Catalina 10.15.6, Xcode 11.6.

I can build and run and test the game normally, until for whatever unknown reason, the game begins freezing every time at the point I try to authenticate. I've narrowed it down to this by using the following bare-bones invocation just after app launch completes:

Code Block
print("A")
GKLocalPlayer.local.authenticateHandler = { vc, error in
print(vc)
print(error)
}
print("B")

Sure enough, "A" is printed, and then execution stops. Activity Monitor lists the app as "not responding," and I have to force quit and restart the Mac before I can successfully run and test the app again. (Or if I'm not interested in testing Game Center features, I can comment out this authentication block and everything works fine.) No problems with any of this when testing the same project built for iOS.

Has anyone got any notion of what could be happening here?