Inactive Tutor answered 18d
When you use the programmatic override command in AppleScript (or Extend Script/JavaScript) on documents with nested/multi-level master pages (a master applied to a master), relative origin offsets or custom ruler origins aren't calculated correctly. InDesign applies the transformation matrix of the nested master page hierarchy again during the script execution, causing the overridden objects to shift up and to the left (or drift off according to master-to-master page margins).
Because manual overrides via the UI use a different internal method than the API's override() method, doing it by hand works fine.