Can't figure out how to move an anchored text frame out of another text frame via javascript

This also may help someone trying to move textframes that are inline… i’m sure it can be cleaner but thought i’d drop it here since i spent WAY to long on this

const { app, AnchorPosition } = require("indesign");
const doc = app.activeDocument
const outsideTextFrame = doc.textFrames.itemByName("outsideTextFrame");
const outsideTextFrame2 = doc.textFrames.itemByName("outsideTextFrame2");
const insideTextFrame = doc.textFrames.itemByName("insideTextFrame");
const insideTextFrameItem = outsideTextFrame.allPageItems[0];
const myInsertionPoint = outsideTextFrame2.insertionPoints.item(0);

// Do the things
insideTextFrameItem.anchoredObjectSettings.anchoredPosition = AnchorPosition.ANCHORED;
insideTextFrameItem.anchoredObjectSettings.releaseAnchoredObject();
doc.allPageItems[0];

// Put it into another text frame
insideTextFrame.anchoredObjectSettings.insertAnchoredObject(myInsertionPoint, AnchorPosition.INLINE_POSITION);
doc.allPageItems[0];