First up, make sure that your code is signed with a stable code signing identity. TCC uses this to track to confirm that version N+1 of your code is the ‘same code’ as version N. See TN3127 Inside Code Signing: Requirements for more about this.
Second, if your final goal is to run this as a launchd agent running in the Aqua session type [1], don’t test it over SSH. In situations like this context matters, and an SSH login session is not the same as an Aqua login session.
Ideally you’d test this by loading it as a launchd agent. To test that, connect to the Mac’s GUI login session using screen sharing and than load and start your agent from Terminal.
Third, is this agent going to be part of a GUI app? If so, make sure you either install it using SMAppService or set AssociatedBundleIdentifiers in your launchd.plist. If not, you may end up needing to embed it within an app-like structure to make TCC happy.
Via a launchd daemon
That’s unlikely to work. CoreWLAN checks for the Location privilege and that’s hard for a daemon to get.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] See LimitLoadToSessionType in the launchd.plist man page. Aqua is the default value, causing your agent to load in GUI login sessions.