The issue is a regression in bash 4.4. See here. The extraneous output can break scripts that read the command output.
According to Allen Wittenauer:
Oh, I think I see the bug. HADOOP_SUBCMD (and equivalents in yarn, hdfs, etc) just needs some special handling when a custom method is being called. For example, there’s no point in checking to see if it should run with privileges, so just skip over that. Probably a few other places too. Relatively easy fix. 2 lines of code, maybe.