UIParent dynamically moves some frames around depending on what's shown or not. There are a few ways around this, each with their own issues.
- Hook UIParent_ManageFramePositions() and reset your anchors afterwards. Note this can't be done in combat since the action bars are protected frames.
- Remove their entry from the UIPARENT_MANAGED_FRAME_POSITIONS table. This may cause taint.
- Set the ignoreFramePositionManager entry in each ActionBar to true. Apparently, this is checked when UIParent considers repositioning a frame and if set, this frame is skipped. I would be wary of this value randomly changing as it is a feature in the default UI and may be in use.
All of these options carry the additional effect of having other managed frames position strangely based on visibility state. This is hard-coded, but may be mitigated by removing any occurrence of
rightRight and
rightActionBarsX from all entries in
UIPARENT_MANAGED_FRAME_POSITIONS if taint isn't an issue.