Interestingly, in Ezekiel 14:9, God says that He has (or has caused) the deception of false prophets:
Then, we have 2 Chron 18:21: “I will go and be a deceiving spirit in the mouths of all his prophets,’ he said. ‘You will succeed in enticing him,’ said the LORD.” This is in response to God’s question to the spirits in Heaven about who will go and cause the King of Israel to fall in battle, if I recall correctly.
Now, I believe Scripture says that “God can neither deceive nor be deceived”. Also, St. Paul says that he had been sent “an evil spirit from God” to beat him and, thus, humble him because of “the abundance of the revelations”. King Saul also had an “evil spirit from God”.
In Isaiah 45:7, “I form the light, and create darkness. I make peace, and create calamity. I am Yahweh, who does all these things.”
In order for all this to be true, God, who himself can not lie, sends an evil spirit to deceive and/or torment His victims. That’s my understanding anyway.