I hope you don't mind me saying that this must be one of the most complicated XFA forms I have ever seen - and I have seen a lot of them in my time. I opened your PDF with the Designer but a lot of your app. 50! script objects seem to come from external fragments and were not available for me to see. Judging by what I was able to see I think that you have scripted basically EVERY aspect of forms activities in a hierarchy of functions. That includes the visibility of whole pages.
Based on my experience I guess that these scripts may be geared to interaction by the current user which works while a PDF is opened and worked on interactively. But if I am right, many of the scripts may not trigger or work as expected when a dataset is loaded because a different flow of events is gone through compared to the interactive use.
Did loading the XML ever work or did you discover that when you tried it for the first time?