Jeremiah is mistaken in his accusation. All of God’s judgments are true and righteous altogether (see Psa. 19:9). However, it is a mystery why God allows false prophets to gain positions of authority, where they can deceive so many with their flowery speeches and misrepresentation of God’s character.
“Now, was it God that deceived them? No, He had often given them warning of judgments in general and of this in particular; but their own prophets deceive them and cry peace to those to whom the God of heaven does not speak peace. It is a pitiable thing, and that which every good man greatly laments, to see people flattered into their own ruin and promising themselves peace when war is at the door; and this we should complain of to God, who alone can prevent such a fatal delusion.” Matthew Henry
Jeremiah 4:10 Then I said, Ah, Lord God! Surely You have greatly deceived this people and Jerusalem, Saying, You shall have peace, Whereas the sword reaches to the heart.