All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
The seeker of knowledge should seek knowledge from trustworthy and reliable scholars, and the Muslim should seek the fatwa of the scholar whom he trusts to be knowledgeable and pious. Allah, The Exalted, says (what means): {So, ask the people of the message if you do not know} [Quran 16:43]
The introduction of Saheeh Muslim reads, “Muhammad ibn Seereen said, ‘Verily, this knowledge is (part of the) religion. So look into (i.e. investigate) whom you take your religion from.’”
Sunan Ad-Daarimi reads:
“It was narrated on the authority of Asmaa’ ibn ‘Ubayd that two men from a deviant group visited Ibn Seereen and said, ‘O Abu Bakr! Shall we narrate a hadeeth to you?’ He replied, ‘No.’ They said, ‘Then we read to you a verse from the Quran?’ He replied, ‘No. Either you leave or I will leave.’ So they left. Some people asked, ‘O Abu Bakr, what harm would it have done if they had read to you a verse from the Quran?’ He replied, ‘I feared lest they read to me a verse and distort it (i.e. add their own distorted interpretation to the verse) and that that would settle in my heart.’”
If you had sought the fatwas of this scholar earlier because you trusted his knowledge and righteousness, then there is no harm in that and you are not required to seek the fatwa of other scholars about all the matters you had asked him about. However, you should be more careful in investigating religious matters or choosing the scholars whose fatwa you seek in the future, especially given that you are a seeker of knowledge. You can also re-investigate the opinions and information that you have learned at his hand and about which you have doubts.
You bear no sin for having sought his fatwas after having come to know that he practiced sorcery, especially if you could not find any other scholar.
Ibn Al-Qayyim wrote:
“I believe that the same ruling applies to the Faasiq unless he is openly Faasiq and calls people to his innovation. The ruling on seeking his fatwa is the same as the ruling on praying behind him and accepting his testimony; it differs according to the place, time, ability, and disability..... When impiety prevails in any given time or place, if the Shariah forbids the Faasiq person from leading the prayer and rejects his testimony, fatwas, and political leadership, then the Islamic rulings would be put to a halt, people's affairs would be ruined, and most of people's rights would be lost.” [I‘laam Al-Muwaqqi‘een]
For more benefit, please refer to fatwas 323014and 347374.
Allah knows best.