Hello Jack,
You code looked like it should have worked. I messed around with it a bit and got it working. All you need to do is replace the type caste VI with a Variant-to-Data VI. They do almost exactly the same thing. The only real difference is that the later translates additional information (ie: number of elements). In you case, it is not immediately clear why one would work when the other does not. If you need a more satisfying explanation, let me know. For now, just replace the VI. The new one is in "All Functions >> Advanced >> Data Manipulation >> Variant" and is called "Variant to Data". Thank you for contacting National Instruments and take care!
Regards,
Aaron B.
National Instruments