Found and fixed the biggest pain in the ass bug ever (after 2 days of debugging)!
The model-free model index 'model_index' which was being passed into duplicate_data() was being
overwritten by the loop over structural models, which was also using 'model_index'!!!