The Merge-Object function pipes $input to Reduce-Object, but the $input variable is not created anywhere. It looks like it should be piping the $Object parameter of the Merge-Object function.
Consequently, when I ran the Merge-Object function, I was getting no output, because it is always sending $null to Reduce-Object.