Echo will fail here when stderr is closed. For example when the caller of the script pipes stderr to another command and that command exits.