Local User LaunchAgent via SSH: Operation not permitted

Solution 1:

This appears to be an issue with the launchctl 'session' that is used for the agent and that is incorrectly inferred by the start command. The new version of launchctl has some new commands for loading agents that allow you to specify this, see here.

The following seems to work via SSH:

launchctl bootstrap gui/<UID> /Users/me/Library/LaunchAgents/org.my.custom.plist

You can then (re)start the service using

launchctl kickstart -k gui/<UID>/org.my.custom

Here <UID> is the user's UID which can be found with id -u <username>.