Deuteronomy 18:22

22 If what a prophet proclaims in the name of the LORD does not take place or come true, that is a message the LORD has not spoken. That prophet has spoken presumptuously, so do not be alarmed.

Read Deuteronomy 18:22 Using Other Translations

When a prophet speaketh in the name of the LORD, if the thing follow not, nor come to pass, that is the thing which the LORD hath not spoken, but the prophet hath spoken it presumptuously: thou shalt not be afraid of him.
when a prophet speaks in the name of the LORD, if the word does not come to pass or come true, that is a word that the LORD has not spoken; the prophet has spoken it presumptuously. You need not be afraid of him.
If the prophet speaks in the LORD ’s name but his prediction does not happen or come true, you will know that the LORD did not give that message. That prophet has spoken without my authority and need not be feared.