Geting a corrupt file message when trying to save file. Close file without saving and reopen to find that it had actually saved any changes that had been made. Closed and re-start software only to experience the same issue after a few times saving the document. Had the same issue with Indesign 2021 prior to upgrade. Issue went away for a while but now seems to be back.
Open the IDML in InDesign Save the file as a new InDesign file with a new name See if the issue persists.
Try resetting your preferences: The easiest way to reset everything is to delete the InDesign preferences: as soon as InDesign starts to boot hold down Shift, Alt, Ctrl (and Apple/Cmd if working on a Macintosh). A dialog will appear asking to delete the InDesign Preferences, select 'Yes' on this dialog. Further info and instructions here if needed: https://helpx.adobe.com/in/indesign/kb/indesign-preferences-support-file-locations.html