In these passages is the account of one of God’s Prophets being deceived by another Prophet. Perhaps the Prophet who deceived was led to do so to test the Prophet who was deceived.
The Prophet who was deceived had been given specific instructions by God. However, he believed the words of the other Prophet, which were contrary to what God had told him to do. He failed God’s test, and God killed him for it.
The Prophet who was deceived did not rely on the Word of God. Rather, he relied on the information given to him by the other Prophet. The only way to prevent being deceived is to rely on the Word of God for our guidance and decisions. It is the only source of pure Truth that we have in this world.