This is caused by a buggy "posts per page" feature. dprevived.com/t/posts-not-showing-when-over-25-posts-are-made-in-thread/3170/#post-32539
The last post link is converted to an URL that contains the page#. It calculates the total # of pages using the old value of 18 posts per page, while when using e.g. 30 posts per page there will actually be fewer pages. The link then points to a page # higher than what exists > page not found.