I don’t think the team is doing what you think.
Those <redirects do not do what you think, and therefore the brew command executed is executed
brew rm
This requires an argument.
I like trying to use a connection without a temporary file. After looking at the man page, I am sure you cannot do this.
Try the following:
brew leaves > leaves brew rm $(brew deps mtr | join leaves -)
source share