I agree. Whatever the RPA software starts with XRUN
runs with the limited privileges of the web browser.
(1) One solution is to run the browser itself has admin. - does this solve the issue?
(2) Another option would be to start the apple script independently and make it wait for a file to appear. And XRUN does nothing else than triggering a 2nd (tiny) script that writes this file. Once the file appears, the admin script does its work (in your case this would be sending the keystrokes).
Here is the same approach shown on Windows: XRUN calls a VBS file that does nothing else than writing a “abc.txt” file. The Powershell script runs as admin and waits for this file to start its admin level work.