Our Prophet did indeed accurately predict the trials and tribulations that would follow his death. For example, he told his disciple Uthman that God would clothe him in a garment which people would try to strip away from him, but that he should not allow them to do so and wear what God had given him. At the time Uthman didn’t understand the meaning of this prophecy. But when he became the third Caliph and then the rebel party of Muslims besieged him demanding he resign (an episode I mentioned) the words of this prophecy became clear to him that the garment God had clothed him with was the Caliphate and that he should follow the Prophet’s instructions and not take it off. For by resigning from the Caliphate a dangerous precedent would be set. Likewise the Prophet predicted that many of his disciples would be killed in the civil strife, naming them by name. However, because all of these events were destined to happen and part of God’s plan, therefore there was no way they could be averted, and the prophecies were such that they were not immediately discernable but became crystal clear after being fulfilled.
If this was spelled out in the Quran, which was written by the Prophet, and it is followed by the letter of the law why was Uthman ever in danger?