IDML is the InDesign file in a basic XML file.
The workaroudn here is that it removes any excess codes built up in the background of the InDesign file. Which can happen over time.
It's this excess code that is bloating the export and possibly causing errors on export.
The IDML file as an XML is then rebuilt as an InDesign file.
This process is 100% compatible as long as it's the same version of InDesign.
As you can imagine and IDML created in 2021 and opened in 2019 wouldn't have some ...