My first thought was are you loading asynchronously (this is the default, BTW), in which case you could be doing the transform before the XML string is fully loaded, whereas manually, the string has time to fully load.
Try
Object1.async = false
before loading the XML string.
Len Speed