Insert tag historian points on a remote tag provider

I want to use the system.tag.storeTagHistory to insert some old data we have on some datapoints. This usually works fine but this time the data comes from an edge device as a remote tag provider and what happens when i use the storeTagHistory function is that the historian creates another drv and the data is stored as if it comes from a different tagprovider.

My remote gateway and tagprovider have this combination:
edgegw : remotetagprovider

and i try to use the storeTagHistory function like this:
system.tag.storeTagHistory("SomeDB", "remotetagprovider", paths, values, qualities, timestamps)

but the data gets stored as
maingw : remotetagprovider

Is there any way to ommit this?