Your myVar parent might point to something quite else; my Help lists “The parent of the Text (a XmlStory, TextPath, TextFrame,Text, Character, Word, Line, TextColumn, Paragraph,TextStyleRange, InsertionPoint, Story, Cell, XMLElement, Footnote, Change, Note or HiddenText).” — in reality, I've rarely seen anything else than simply “Story” or “Cell”.
A good way to debug this kind of stuff is to check what InDesign thinks myVar and its parent are:
alert (myVar.constructor.name+” / “+myVar.parent.constructor.name);
You can always try myVar.parentTextFrames[0] — this will point directly to the frame holding your text.
Theoretically, you ought to be able to change the contentType of a frame's properties from TEXT_TYPE to UNASSIGNED, but I remember having wrestled with this before. It might be ID simply does not believe you when you want to change the type of a Text Frame …