I am making a script to create a simple dataset where one column is the name of the product and the other is the weight. I choose this weight using system.tag.queryTagHistory and I save it in a variable to later use it when creating the dataset.
You are placing a dataset inside of a dataset. queryTagHistory() returns a dataset. Which you then place into a row of your scripted dataset. Not permitted. The error is occurring when the gateway is trying to deliver this invalid dataset to the designer for you.
Extract the value from the history dataset to place in your row.