If the output is empty _and_ there is output sent to stderr, then it shows the stderr output as a tool tip and doesn’t replace input.

I tried with ‘printf ""’ but that did replace input (with empty string).

Indeed, you're right. It turns out to be an issue with grep. It's not that it there's is output on stderr, but its exit code is actually 1 if it does not match any lines.
"Normally, exit status is 0 if selected lines are found and 1 otherwise. But the exit status is 2 if an error occurred, unless the -q or --quiet or --silent option is used and a selected line is found."
That's an unexpected feature for me. :)

Maybe you could add a tooltip saying "command failed (without any output)" or so?

--
Meryn