Modal Operator -- "invoke" not being called while invoked through script
It is intentional!
This behavior is controlled with
bpy.ops.some_operator('INVOKE_DEFAULT')
or
bpy.ops.some_operator('EXECUTE_DEFAULT')
and it's assumed that a script calls execute by default
and a button calls invoke.
it is in the doc's but somewhat obfuscated.