Found the solution:
You have to change the return format to a scalar for the named query and then return the transform script:
dict={ "instanceStyle": {
"classes": ""
},
"instancePosition": {}
}
list=[]
for i in range(value):
list.append(dict)
return list