Hello
Thank you for your question and reaching out.
In your script It may require some Network access which is not available in VPN.
Please go to Start > Control Panel > Programs and Features -> Select Visio -> Right click -> Select Uninstall.
--If the reply is helpful, please Upvote and Accept as answer--