Error code

macOS -128

MACOS-128
System Error Code· A POSIX/system errno returned when a system call fails.

What it means

User cancelled operation (userCanceledErr) — the user dismissed a dialog or pressed Command+Period to stop the operation..

How to fix it

  1. No action required if the cancellation was intentional.
  2. extend the timeout in the calling script.
  3. ensure the automation target app is responsive before sending events.

Not affiliated with macOS. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.