Answer
This happens when someone publishes or synchronizes a Custom Object (like a custom field) on the same logical unit your view depends on while your script is running — that publish/sync action invalidates and recompiles the underlying generated packages (like a *_CFP package) mid-flight, which is what your script's error is catching in the act. You can check the 'Refresh Server Cache' window to see when the Custom Objects cache was last refreshed (though not by whom or for which object), and confirm a given logical unit's custom fields show as synchronized in the Custom Fields window. No manual recovery action is normally needed — once the underlying object finishes recompiling, simply re-running the same script succeeds, since nothing was actually broken, just transiently invalidated.