The structure of the OT prophetic message is not entirely clear. The fact that Jeremiah could say that his words ended in Jer 51 and then have another chapter 52 could be easily explained by any of the following:
- The prophetic message of Jeremiah ends with Jer 51. Jer 52 is just historical fact and not part of Jeremiah's "prophecy".
- Jeremiah really did write Jer 51 as his final words but some ancient scribe found some further material of Jeremiah and appended it to his book.
- Jeremiah's words ended with Jer 51 and his secretary, Baruch (or someone else) added the historical material.
Of the standard commentaries, most prefer the third option.
Ellicott concludes:
Thus far are the words of Jeremiah.—The words are clearly of the
nature of what we should call an editorial note by the compiler of
Jeremiah’s prophecies, Baruch or another. He is careful to inform his
readers that the narrative that follows in Jeremiah 52 was not written
by Jeremiah.
Barnes is similar:
Thus far ... - Whoever added Jeremiah 52, evidently felt it his duty
to point out that it was not written by Jeremiah.
The Pulpit commentary is also similar:
Thus far, etc. Proving that the Book of Jeremiah once ended with ch.
51.