You're missing the -AllUsers switch after the pipe for Remove-AppxPackage.
The correct command should be Get-AppxPackage -AllUsers -Name $bloat | Remove-AppxPackage -AllUsers