Jeremiah
Jeremiah 40:2BSB·traditional attribution

The captain of the guard found Jeremiah and said to him, “The LORD your God decreed this disaster on this place,

Matthew Henry Presbyterian @wholebiblehenry

The title of this part of the book, which begins the chapter, seems misapplied (The word which came to Jeremiah), for here is nothing of prophecy in this chapter, but it is to be referred to Jer 42:7, where we have a message that God sent by Jeremiah to the captains and the people that remained.

Commenting on Jeremiah 40:1-6

John Gill Reformed Baptist @doctorgill

And the captain of the guard took Jeremiah,.... When he mustered his prisoners, to his great surprise he found the prophet among them, whom he took out from them, and set him free; though, before he dismissed him, he had the following conversation with him: and said unto him, the Lord thy God hath pronounced this evil on this place; the city of Jerusalem; from...

Jamieson-Fausset-Brown Reformed @jfbcommentary

The Babylonians were in some measure aware, through Jeremiah's prophecies (Jer 39:11), that they were the instruments of God's wrath on His people.