The domain mod getInsertDefaults prepares data for data mods but given that it is in a loop, it expects all restrictions to be applied on all data mods. For example a domain mod creating a user, and a an address will loop over both insert defaults for user and address both times. Restrictions such as getRequiredData only applies to one each time but given the scope is not isolated this impacts the other.
Isolate scope, introduce anonymous functions for data defined in getInsertDefaults.