There is a bug here I believe, robocopy should mirror from created $tempDirectory to $Location. As the code is written currently it mirrors from $Location to $Location wich fails.
I believe $PSBoundParameters.Set_Item("Path", $location) should rather be:
https://github.com/sbergwall/RobocopyPS/blob/ca1653d37b632f0a52614e8cff79a99e18676e47/RobocopyPS/functions/Remove-RoboItem.ps1#L59
There is a bug here I believe, robocopy should mirror from created $tempDirectory to $Location. As the code is written currently it mirrors from $Location to $Location wich fails.
I believe
$PSBoundParameters.Set_Item("Path", $location)
should rather be: