It looks like it has to do with your $Name parameter being a string array, while in the assignment of the $Operator variable it's being treated as a string. If I change the param block to [string]$Name I get the correct result.
I'm guessing when you tested it in the console, you tried $Name = 'name' and not [string[]]$Name = 'name'.