Environment:
Qlik Sense Enterprise on Windows
This happens because the app is not available on the Engine of the node where the task is executed.
If needed, load balancing rules can be altered to fix the issue, however the recommended approach is to change the central node name in the script as described on the help site: App Metadata Analyzer
SET vu_central_node_host_name = 'my_central_node.domain.com';
Also, alter the virtual proxy prefix if needed:
SET vu_virtual_proxy_prefix = 'my_virtual_proxy_prefix';
In the QMC, in the settings of the virtual proxy used, make sure to only include the Central Engine service in the Load Balancing section.