`dummy`, when you run, shows that `mergedata` complains that it can't find a data container named `cvar2`.  I think that's relevant to finding the problem.

I renamed the variables to have "local" and "passed" suffixes instead of "" and "2".