Thank you for all your help. At the very least, I now have a much better understanding of secure templates and handlers.
I am going to give up on getting this function to work. I know it used to work in original vanilla wow (
BeastTraining) with no special secure templates, but no longer. It might be that it can
only be called from a bliz addon, and its just hardwired that way, never changing. Who knows.
Anyway, thanks again and I did learn from this