I can't find this in the documentation, but Zenity appears to do backslash expansion on the string passed to --text, which is then interpreted as Pango Text Attribute Markup, an HTML-like format. (Thanks to manatwork for pointing this out.)
First, you need to put double quotes around the command substitution, to avoid expansions performed by the shell. This is general in shell programming: always put double quotes around variable substitutions and command substitutions (i.e. "$foo" and "$(foo)"), unless you know why you can and must leave them off.
Second, you need to double all the backslashes coming from the application, and to replace the characters . You can do this with sed.
/usr/bin/zenity --error --text \
"$(/usr/bin/some-application |
sed -e 's/\\/\\\\/g' -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g')"
Strictly speaking, this does not reproduce the output from the application perfectly: if there are multiple newlines at the end of its output, they will be stripped. The stripping is performed by the shell's command substitution construct, so to avoid this, you need to ensure that the substituted command's output does not end in a newline.
output="$(/usr/bin/some-application | sed 's/\\/\\\\/g'; echo a)"
/usr/bin/zenity --error --text="${output%a}"
The difference won't be very visible in the dialog box though.
--text="$( ... )". Quotes and backslashes that result from expansions should not have any special meaning or side effects. My guess is whitespace in your command output is causing the output to be split into multiple words. In that case,zenitywould see a--text=<first word>and the rest of the output as normal arguments. Quoting with"prevents word splitting. – jw013 Apr 30 '12 at 20:07