Deuteronomy 18:20-22

18:20 But the prophet who speaks a word presumptuously in my name, which I have not commanded him to speak, or who speaks in the name of other gods, that same prophet shall die.”

18:21 You may say in your heart, “How shall we know the word which the LORD has not spoken?”

18:22 When a prophet speaks in the LORD’s name, if the thing doesn’t follow, nor happen, that is the thing which the LORD has not spoken. The prophet has spoken it presumptuously. You shall not be afraid of him.