As it currently stands, Magic / Object Masks are inherently fragile... they are mostly static mask files generated by an algorithm, one for each frame. The algorithm looks at all the
input pixels of a given reference frame in a clip instance, and, guided by a user defined stroke (or strokes), dynamically generates a mask for the
arbitrary pixel area that it believes the user is most likely targeting on that reference frame. Tracking that chosen area generates a static cached mask file for each tracked non reference frame of the clip instance.
If you later adjust something... maybe it was in the same node, maybe in another node or maybe you just made a tiny adjustment on another page... whatever you did, the (static) mask track is now gone and only the occasional (dynamic) reference frame lives to tell the tale.
It's because (regardless of your best intentions)
your adjustment has caused a change to the input pixels of the Magic Mask, and, as far as the software is concerned, if the input data has changed then
any previously cached data based on that input must be discarded / regenerated.
You can often protect yourself against such unexpected loss of cached masks by careful separation and management of your Color Page node operations ... there are some examples of that
in this thread... but once in a while you might still lose them, it shouldn't happen often, but all cache files are temporary by nature.
Another way some folks have developed to protect themselves against casual magic mask cache loss, is to nest any magic mask generation operations
inside a Compound Clip ie create a compound clip from the source clip instance, open the compound clip in its own timeline, add the magic mask to the source image as needed, generate the mask cache, and then finally step back out to the parent timeline... thereafter, when you manipulate the pixels of the compound clip, you are manipulating a separate pre-masked object rather than manipulating the pixels of the source clip itself (ie the mask input), thus the mask is preserved. Do be aware though that nesting magic masks inside compound clips comes with the current drawback that such contained masks can be 'hidden' from other standard software operations. Eg Using the Magic Mask >> Regenerate Object Mask > All Clips function at the main timeline level will not regenerate masks for any such nested clips; similarly, the automatic mask regeneration that's triggered via the Delivery Page 'Render' command will skip any nested masks.