Allow ssh-keygen-wrapper to access "System Events" for all users in the same computer
You should permit your AppleScript to access System Events from system preferences, 
System Preferences &gt; Security &amp; Privacy &gt; Privacy &gt; Accessibility.

Click on the + icon under that panel and add your AppleScript.

If that not works, try adding it under Full Disk Access which you can select from the left pane.