While comparing 2 documents, if the form fields have differences( in the first document check box field is unchecked and in the second document, check box field is checked), then the changes are not tracked.
Below is the code used
Document doc1 = new Document();
doc1.loadFromFile("D:\\doc1.rtf");
//Load the other Word document
Document doc2 = new Document();
doc2.loadFromFile("D:\\doc2.rtf");
CompareOptions co = new CompareOptions();
co.setIgnoreFormatting(true);
doc1.compare(doc2, "Author",co);
doc1.saveToFile("D:\\Compare1.docx", FileFormat.Docx_2019);