Thanks for your inquiry. Please call Document.UpdatePageLayout method before saving the document. This method formats a document into pages and updates the page number related fields in the document such as PAGE, PAGES, PAGEREF and REF.
If you still face problem, please attach your input Word document here for testing along with code example. I will investigate the issue on my side and provide you more information.