The property 'structureTypeName' contains a textual representation of the type of the object. In this case, it will always be "DomainModels$DomainModel", as you are filtering domain models. As the result of filtering will be an empty array, taking the first element of that will yield 'undefined', which causes the error you get later on.
It looks like you want to get the domain model for the module called 'MyFirstModule'. If you change the line to the following, it should work: