For a divorce to count as such, it is stipulated that the husband should be of sound mind and do it voluntarily. If he is not of sound mind or he is forced to do it, then his divorce does not count as such.
Ar-Ruhaybaani (may Allah have mercy on him) said: The Muslims are unanimously agreed that if a person loses his mind and that is not the result of consuming an intoxicant that is haraam, such as in the case of sleep, loss of consciousness, insanity, taking medicine that makes one lose one’s reasons, or sickness, then his divorce does not count as such.
End quote from Mataalib Ooli’n-Nuha, 5/322.
It was narrated from ‘Aa’ishah (may Allah be pleased with her) that the Messenger of Allah (blessings and peace of Allah be upon him) said: “There is no divorce in the event of coercion.”
Narrated by Ahmad, 25156; Ibn Maajah, 2036. classed as hasan by Shaykh al-Albaani (may Allah have mercy on him) in Saheeh Ibn Maajah, 1/348.
Ibn al-Qayyim (may Allah have mercy on him) said: Our shaykh, Ibn Taymiyah, said: Coercion means losing one’s reasoning and understanding. That includes divorce (talaaq) issued by one who is mentally challenged, insane, intoxicated, forced or in such a state of anger that he does not know what he is saying, because in all of these cases he has lost his reasoning and understanding. Divorce only counts as such when it is issued by one who intends it as such and is aware of it.
End quote from Haashiyat as-Sunan, 6/187
Based on that, if this bewitched husband was in a state where the spell or witchcraft had affected his reasoning in such a way that he became like one who was insane, then his divorce does not count as such. This same applies even if the spell did not reach this extent, but it affected his decisions and choices. In that case his divorce does not count as such because it is like the divorce of one who was compelled.
But if the spell did not affect his reasoning or his decisions and choices, then his divorce does count as such.
Shaykh Ibn Jibreen (may Allah have mercy on him) was asked:
Does the divorce of one who is under the influence of witchcraft count as such or not?
If the spell has overwhelmed his reasoning and made him like those who are insane, then his divorce does not count as such, because in order for a divorce to be valid, it is stipulated that he should have formed the resolve to do that, because Allah, may He be exalted, says (interpretation of the meaning): “And if they decide upon divorce…” [al-Baqarah 2:227]. The one who has lost his mind cannot decide or intend to do anything.
But if the divorce was issued with understanding and awareness of the concequences of divorce and what it could lead to of separation, then it counts as such.
But if the spell was done to separate him from his wife and create hatred between them, and he could not find relief except in divorce, according to what Allah says (interpretation of the meaning): “…And from these (angels) people learn that by which they cause separation between man and his wife …” [al-Baqarah 2:102], then it seems that it does not count as such, because he was compelled to do it. And Allah knows best. End quote.
And Allah knows best.