fix(nc): reduce redundancy in the reference code generator and return the correct error code 
fix(nc): reduce redundancy in the reference code generator and return the correct error code 

For tehe case of an failed information model setup. Changes were made by @ursfassler (Urs Fässler). (#5197)
JGrothoff/open62541,open62541/open62541,JGrothoff/open62541,JGrothoff/open62541,jpfr/open62541,jpfr/open62541,open62541/open62541,JGrothoff/open62541,open62541/open62541,jpfr/open62541,open62541/open62541,jpfr/open62541