We have recorded the issue here:
protegeproject/protege#993 (comment)
The same versions of OWL API and operating systems causes completely different patterns of change. You can see that there are 4 pull requests from the same Protege versions causing widely different serialisations of the edited file..
@ignazio1977 do you think this is fixed in a later version of owlapi 4?