Hi,
I just stumbled about this issue and would like to share the solution that allows using the dialog:
In line 5 you create a new text element but you don't use the correct path.
As you do in line 1 with the dialog, you also have to instantiate the text object by using
new sap.m.Text.