According to the famous scholar of Deobandis Molvi Tariq Jameel Prophet Muhammad ( Rasool Allah) was a sinful person. Molvi Tariq Jameel writes in his book “Bayanat e Tariq” on page 113 that “Glorious is God! It is strange. Allah is greatest! Sin was yours(Rasool Allah). But your forgiven. Allah forgave you” Maz’Allah
We have attached the original reference below but this is not an Islamic Belief. According to Quran Sura Jin Verse 27 – 28 “As for the messengers whom He has chosen, He guards them from the front and from behind to make sure that they have delivered the messages of their Lord” (Al-Jinn 72: 27 – 28). So Allah protects Prophets from everything including sins.
According to all Imams of Islam (Hanafi, Shafai, Malikis) the Prophets are protected both from minor and major sins. If anything happens then that should not be called a sin that is Hikma of Allah Azzawajal for example if the Adam did not ate the fruit from the tree which was not allowed then there was going to be no Earth and Humans and Adam is again in the Paradise.