The story of the trial of Al-Imaam Wakee bn al-Jarraah (d.196H) at Makkah when he came on Hajj from Kufah is well documented in the books of Islamic history such as Siyar Alaam Nubulaa, Tabaqaat Ibn Sa'd, an-Nihaayah wal-Bidaayah, etc.
The trial almost cost Al-Imaam Wakee his life despite being a mighty scholar, rahimahullaah. That was the same Wakee that was the teacher of Al-Imaam Ash-Shaafiee, Al-Imaam Ahmad, Al-Imaam Ad-Duuree al-Muqri, Ibn Zakwan al-Muqri, Ibn Mubaarak, the sons of Aboo Shaybah, Yahya bn Maeen, Alee bn al-Madeenee, Ishaq Bn Ruhaaway, Abdullaah bn Maslamah al-Qa'nabee, Qutaybah bn Saeed, Abdurrahman bn Mahdee, Musaddad bn Musar'had, and host of others. You would recall the popular lines of poem Shakautu Ilaa Wakee Su'ua Hifdhee...attributed to Al-Imaam Ash-Shaafiee about Al-Imaam Wakee.
But it happened that Al-Imaam Wakee, who was one of the foremost students of Al-Imaam Sufyaan Ath-Thauree (d.166H), made a fundamental mistake in passing knowledge to the people of Makkah who had come to benefit from him when they heard he was on Hajj from Kufah, his base.
Al-Imaam Wakee had unknowingly relied on an extremely weak report that the body of the Messenger of Allaah ﷺ changed a day after his death.
When the bigwigs of Makkah heard of that statement from Al-Imaam Wakee, they rose against him and sought to execute him for blasphemy.
He was arrested and detained awaiting the final judgement but as Allaah would decree the Khaleefah at the time, Haarun Ar-Rasheed, was in Makkah for Hajj, from Iraq. The matter was brought before him for the final adjudication.
Scholars were called to make their points against him. Many of them ruled that he should be executed after being declared a grievous deviant who dishonoured the person of the Messenger of Allaah ﷺ.
Among the scholars called was Al-Imaam Sufyaan Ibn Uyaynah (d.198H), the scholar of Hijaaz at the time. Prior to that period of time, there were some serious misunderstanding between him and Al-Imaam Wakee. Despite that, it was the singular statement from him before the khaleefah that Allaah used to save Al-Imaam Wakee.
He said: 'He should not be excuted, he only heard a report and narrated it.'
For that, the Khaleefah ruled that he should be set free eventhough the governor of Makkah at time, al-Uthmaanee by appellation, was not pleased with that.
Source: Tabaqaat Ibn Sa'd, 6/394, as cited.