I will do my best to try to answer as well as possible, if someone sees something is incorrect please say so.
About setting _data to null, use Set _data without passing any value to it.
In this example, _data must be of type WeaponData and have another reference to the json file, then deserialize the json to the data type needed.
The deserialization part is done by the CreateInstance node, in the c# part it is _data = WeaponSettings.CreateInstance<WeaponData>()
, but in c# it is specified to return an object of type WeaponData, in Visual Script it returns T and does not know what type it is, so after CreateInstance it is necessary to perform a cast.
If you want to use debug log you can get the content directly from the json or serialize the object to get the string and pass it to debug log. I’m not sure if the error occurs in this part or not, if you can attach some image to see it it would be helpful.
About the error, something similar happened to me when using the Flax 1.6 option from the laucher with the CastValue node. I solved it by compiling flax from source, but it also works with the last option master branch (daily) from launcher.