Jeremiah 40:9
And Gedaliah the son of Ahikam the son of Shaphan sware unto them and to their men, saying, Fear not to serve the Chaldeans: dwell in the land, and serve the king of Babylon, and it shall be well with you. And Gedaliah the son of Ahikam the son of Shaphan sware unto them and to their men, saying, Fear not to serve the Chaldeans: dwell in the land, and serve the king of Babylon, and it shall be well with you.
Jeremiah 40 to 45 belongs after Jeremiah 39:1-14 in chronological order, and Jeremiah 40:9 stands within that later block. The book of Jeremiah as a whole is not arranged in chronological order. The timing of the chapter containing the verse is nevertheless made clear by the chapter itself. That displacement in arrangement makes no change in the teaching.
The verse records sworn counsel to the captains and their men not to fear serving the Chaldeans, but to dwell in the land and serve the king of Babylon with the promise that it would go well with them. That counsel was to remain in the land under Babylonian rule. Had the people heeded it through Jeremiah they would have had protection there. Instead of remaining they chose to flee to Egypt.