Jeremiah 34:5

But thou shalt die in peace: and with the burnings of thy fathers, the former kings which were before thee, so shall they burn odours for thee; and they will lament thee, saying, Ah lord! for I have pronounced the word, saith the LORD.

The promise belongs to the history of the two years before Jerusalem fell.
From chapter 20 onward Jeremiah is not in chronological order, having been disarranged when put together in book form.
In chronological order chapter 34 follows chapters 27, 28 and 21 and precedes chapters 37, 32, 33, 38 and onward.

It is part of the account concerning Zedekiah and the promised release under the jubilee law of servants and others who were oppressed or in debt.
That release had not been carried out since the time of Moses.
It belongs to the record of the sad conditions in Judah that caused Jeremiah to weep — false prophets, utter repudiation of the law of God and the principles of righteousness, and persecutions of Jeremiah himself.
These things were preserved to show the enormity of sin and its sure consequences.

It points to the same time as Ezekiel's promises of Israel's gathering and renewal.
Those promises include the return to the land.
In this application it belongs to the prophecies of Israel's deliverance and restoration.