Update sequence produces gap
I had a requirement to migrate all the variables from one instance to other, as there is no out of box feature to import variables to a site , I decided to go with custom script. When I'm executing the script,
I got an API error which says "Update sequence produces gap", I made an analysis on this and found I were trying to set display order to the variable ($variable->DisplayOrder = $this->variableDataArray[$varIndex]['DisplayOrder'];)
and that cause the issue, I commented that line and the script executed as expected. This information might help someone who have similar kind of requirement.