I think the main issue with this function is actually load_EML_units breaking.
this call: unitList_nS <- EML::get_unitList(x = EML::read_eml(system.file("share/EML-nS-unitDictionary.xml", package = "datamgmt"))) returns an empty list.
I believe you could just get the units from x$unit - bypassing the EML::get_unitList call entirely.