Can someone give a clue?

I haven’t tested this, but have you tried

function onLoadIntoSlot()

or

function onInit()

This delays the callback even more. At the moment your script is triggered when the script module is loaded, which is before the program is loaded.

Like I said, I have no idea if this is the answer, but it seems like an option.