I presently have a LibreOffice document that doesn't count correctly in pagination either in editing or in export to PDF.
I am noticing this behavior after defining separate page settings for left and right so that there is more space in the inner margins than the outside margins, and placing a page number in the top outside corner.
The document as I've seen misses numbers in its count, and when uploaded to Amazon KDP to make a paperback, complains about out of bounds count for four pages in a row.
When I went to see what was going on, it had skipped a count before the four pages, then displayed the opposite pagination, placing the page numbers on the top inside corner, and further in than KDP wants things to be to the spine.
I have not experienced this before, but this may have been caused or triggered by my creating a book by saving individual chapters and copy-pasting their contents into the book's interior. I suspect I may be able to avoid this behavior by using my previous process, but it would be nice to know how to avoid and/or correct pagination faults and miscounts.
I am running LibreOffice 126.96.36.199 under Linux Mint 18.3.