MSTeams Deployment fails with exit code 1073807364

Hello everyone,
I recently packaged Microsoft Teams and encountered an unusual behavior. After a user chose to defer the installation, the process eventually completed but returned an exit code of [1073807364].

PSADT script code:

    $AppxTeams = Get-AppxPackage *MSTeams* -AllUsers
    $provisionedTeams = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like "*Teams*" }

if ($AppxTeams -or $provisionedTeams) {
    Write-ADTLogEntry -Message "Found $($AppxTeams.PackageFullName) or $($provisionedTeams.PackageName). Uninstalling Microsoft Teams..." -Severity 1
    Start-ADTProcess -FilePath "$PSHOME\powershell.exe" -ArgumentList '-Command "Get-AppxPackage *MSTeams* -AllUsers | Remove-AppxPackage -AllUsers"'
    # Pause to ensure uninstallation completes before installing Microsoft Teams
    start-sleep 3

} else {
    Write-ADTLogEntry -Message "Microsoft Teams is not installed. Beginning installation..." -Severity 1
}
    ## <Perform Installation tasks here>
    Write-ADTLogEntry -Message "Installing Microsoft Teams..." -Severity 1
    Start-ADTProcess -FilePath "$($adtSession.DirFiles)\teamsbootstrapper.exe"  -ArgumentList "-p -o `"$($adtSession.DirFiles)\MSTeams-x64.msix`"" -PassThru

Logs:

[Install] :: Error Record:

-------------

Message               : Execution failed with exit code [1073807364].

FullyQualifiedErrorId : ProcessExitCodeError,Start-ADTProcess

ScriptStackTrace      : at Start-ADTProcess<Process>, C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 20256

at Install-ADTDeployment, C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\Invoke-AppDeployToolkit.ps1: line 252

at <ScriptBlock>, C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\Invoke-AppDeployToolkit.ps1: line 692

PositionMessage       : At C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\Invoke-AppDeployToolkit.ps1:252 char:5

+     Start-ADTProcess -FilePath "$($adtSession.DirFiles)\teamsbootstra ...

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
[Install] :: Displaying Dialog Box with message: Error Record:

-------------

Message               : Execution failed with exit code [1073807364].

FullyQualifiedErrorId : ProcessExitCodeError,Start-ADTProcess

ScriptStackTrace      : at Start-ADTProcess<Process>, C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\PSAppDeployToolkit\PSAppDeployToolkit.psm1: line 20256

at Install-ADTDeployment, C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\Invoke-AppDeployToolkit.ps1: line 252

at <ScriptBlock>, C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\Invoke-AppDeployToolkit.ps1: line 692

PositionMessage       : At C:\Windows\IMECache\fff3828d-1c94-43e9-a004-1a0b617f1b1a_3\Invoke-AppDeployToolkit.ps1:252 char:5

+     Start-ADTProcess -FilePath "$($adtSession.DirFiles)\teamsbootstra ...

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
 
[Finalization] :: [Microsoft_MSTEAMS_25275260140022815_X64_EN_1] install completed with exit code [1073807364].

There was a similar topic posted last year: Install failing with 1073807364 - The Toolkit / General Discussion - PSAppDeployToolkit Community

and I believe this is caused by the deferral option.
Has anyone experienced this before or know why this happens?

Try with this:
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\teamsbootstrapper.exe" -ArgumentList "-p -o $($adtSession.DirFiles)\MSTeams-x64.msix" -PassThru
We don't use extra quotes for -Parameters in our 3.x package so I don't think you need it in the -ArgumentList for 4.x.