I think I could reproduce your problem by simply starting a second instance of Safari:
What I observe then is is:
The AppleScript URL actions (including the %SafariURL% token) always refer to the second instance of Safari.
The JavaScript actions (see above) always refer to the first instance of Safari.
It is irrelevant which of the Safari instances is frontmost.
So, if the second Safari instance has no open document then the AppleScript actions give me the error you described (Invalid index -1719). The JavaScript actions work fine (since they are ignoring the second Safari instance).
Closing the second, document-less Safari instance makes the AppleScript actions work again.
I would strongly advise people never to launch two instances of any Mac application unless they know for sure that the application is designed for it (I believe Chrome is).
Almost no Mac applications are written expecting to be launched multiple times, and there are many ways this could go wrong, including corrupting preference or cache files, overwriting settings or documents, etc.
Mac applications are simply not written to allow for this kind of behaviour, they expect to be the only instance of themselves running in the user space (you can have multiple instances across multiple users, obviously).
I completely agree. According to the link@nikivi has posted above it seems the issue came to life because of an Alfred workflow explicitly dedicated to opening multiple instances of a program:
The open command gives us extra control when opening apps, such as making new instances or relegating to the background. This Workflow emulates those options with File Actions.
It seems the author of the workflow forgot to mention possible side effects