Zenity is lean tool for creating very simple GUI-Applications from the commandline.
Use zenity --help to see the options:
zenity --help
Usage:
zenity [OPTION...]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-general Show general options
--help-calendar Show calendar options
--help-entry Show text entry options
--help-error Show error options
... and so on.
For example, if you issue the command:
zenity --info --text "Just a Demo"
displays a small dialog with a light bulb, an OK-Button, and the text "Just a Demo", try it yourself.
The usual way to do more useful things is, to capture the message, produced by zenity:
msg=$(zenity ...)
To your second question, why it failed: From the short message you reported, it can't be answered.