From the logs it looks like it's having issues uninstalling the previous version of Traps.
It all seems to go south starting on line 540.
MSI (s) (08:7C) [13:27:28:392]: RESTART MANAGER: Failed to retrieve the list of applications that hold files in use; Windows Installer will use the built-in FilesInUse functionality. Error: 6
Info 1603. The file C:\Program Files\Palo Alto Networks\Traps\winutils.dll is being held in use by the following process: Name: cytray, Id: 8792, Window Title: '(not determined yet)'. Close that application and retry.
And if I'm reading this correctly, it may explain why it works via command line while logged on versus a non-interactive command line.
CYV-14380
If you attempt to uninstall Traps but have administrative privileges only through fully enabled User Account Control (UAC), the uninstall is unsuccessful. This is because the uninstaller does not evaluate UAC access when it performs a self-security validation step to ensure the uninstall command was initiated by an administrator with the necessary permissions.
Workarounds:
•Execute the agent uninstall process from Add/Remove Programs with admin privileges.
•Execute the agent uninstall using msiexec /x and supply the UNINSTALL_PASSWORD argument. For more information, see Uninstall the Traps Agent Using Msiexec . You must have the agent installer MSI to use this workaround.
-Kris