After the demise of Ayatullah al-Uzma Haaj Shaykh Muhammad Hasan Najafi (r.a.) (the author of al-Jawaahir) the people considered Shaykh Murtuza Ansari as the Marjae Taqleed (the most learned Mujtahid to be followed).
Consequently, they requested him to compile his Tauzeeh al-Masael (book of Islamic Law). Upon this he said, I refuse to accept this great position because Sayyidul Ulama (the chief of the learned), Ayatullah Mazandarani is yet amongst us. He is more learned than me and resides at Babel. Thus I cannot compile my own Tauzeeh al-Masael.
Shaykh Murtuza Ansari wrote a letter to Sayyid ul Ulama requesting him to come to Najaf al-Ashraf so that he may assume control and supervision of the Shiah institutes of learning.
Sayyidul Ulama replied to Shaykh Ansari, It is true that when I was at Najaf al-Ashraf, I used to be more knowledgeable in jurisprudence when I held debates with you. But I have settled down in Babel for quite some time. I do not participate in classes nor do I teach any more. I have also stopped all kinds of debates and discussions. Hence, I consider you more learned and eligible for this position and request you to accept the same.
Despite this communication, Shaykh Murtuza Ansari refused to accept the position of Marjae Taqleed and thought to himself, If my Master,Hazrat Imam Mahdi (as) gives me the permission and bestows favor upon me by appointing me to this post, I shall accept it.
One day Shaykh Ansari was delivering a lecture to his students. A stranger entered the gathering. He seemed to be of a noble and dignified lineage. The Shaykh welcomed him with respect. The stranger posed a question to Shaykh Ansari in the presence of his students,
What is the order for a woman whose husband has transformed into any other form (Maskh)? (Maskh is the transformation of a human being into a stone, plant or an animal. This type of punishment was prevalent in the age of Prophets prior to Holy Prophet (sawa)). Since this type of punishment has not been decreed for the people of this age, we do not find this problem in any of the books of Islamic Law.
Shaykh Ansari answered, as this question is not mentioned in the books of jurisprudence, I am unable to reply.
But suppose such an eventuality does occur, then what would be the duty of the woman whose husband has undergone transformation? the stranger persisted.
At this Shaykh Ansari replied, My opinion (Fatwa) is that a woman whose husband has turned into an animal should observe iddah of divorce and after this period, she can remarry. It is because her husband is still alive and has a soul intact. As for the woman whose husband has turned into a dead object, must observe the iddah of death (of husband). She can marry only after this iddah. This is due to the fact that her husband has turned into a dead thing and should be considered dead.
Upon hearing this gentleman said, You are a Mujtahid! You are a Mujtahid! You are a Mujtahid!
Then he got up and went out of the gathering. Shaykh Ansari realized that it was none but Hazrat Imam Mahdi (as) and that he (as) has given him his express permission to become Marajae Taqleed. He told his students to search for this gentleman. The students rushed out, looked for him everywhere but without success. After this Shaykh Ansari agreed to compile his laws of Shariah so that people could follow him (i.e. do his Taqleed).(Ganjeena-e-Danishmandan volume 8)