Hi Morten,
TestStand does try to figure out the type of the variant and tries to change the type of the TestStand variable to match the type of the variant. If you change your local variable in your example sequence to a number or a container, it gets replaced with a string because the variant contains a string.
The reason the value of the variant is not stored in the subproperty of your custom step type is because the type of the subproperty cannot change to match the type of the variant. To allow this type change, change the subproperty to be unstructured. This can easily be done by setting the flag PropFlags_UnstructuredProperty in the subproperty.
To do this, go to the step definition (in this case VariantTest Step Type) and open the properties dialog of the subproperty. Press the Advanced... button to open the Edit Flags dialog. Scroll down and find PropFlags_UnstructuredProperty. Check its checkbox and close all the dialogs by clicking the OK button.
Try it and let me know.
Regards,
Jose