Hey @jdavis,
Good catch. Coincidentally I had a similar issue a couple of days ago, I have a js query preparing data for an API post call and I added a simple script to my button,
prepareData.Trigger({onSuccess: createInvoice.trigger()})
I kept getting errors on my createInvoice trigger until I manually added the event handler within the query's on success out of the box section, which makes it work seamleslly. It does seem like a bug/race condition when manually writing the onSuccess function.
@Paulo, have tagged this as bug although not sure it is one.