Hi @AVR
Which user is running the automation?
Which user is running the script on the VM?
Do those users have permission to download and store software on that VM?
Maybe a different GPO is enabled for remote connections than a local session?
If you are running that script locally... are you doing this with administrative rights? So you (maybe) have more permissions during the execution than the automation user?!
What does your script (part of it) look like?
It might be essential to see how you connect to the VM and start the installation.