and although the Prophet (peace and blessings be upon him) was informed in the course of events that Allah would protect him from people, he had not initially been told that he would be protected from all forms of harm.
As for the earliest believers, they were not given such assurance. Likewise, Khubayb ibn ‘Adī, whom the polytheists crucified after taking him outside the Sacred Precinct, did not utter a word of disbelief. His story is recorded in the Sahīh. It may, however, be said that their purpose in this was not to make him return to their religion, for he was one of the Ansār, and they were killing him in retaliation for those of theirs who had been killed at Badr. This differed from their treatment of their relatives, allies, and clients, whom they loved and honored: all they wanted from them was disbelief after faith.
Allah has condemned in His Book those who apostatize and succumb to trials, even under coercion. This is what Allah condemned in His words:
“But those who open their hearts to disbelief.”
Surah al-Nahl, 106.
Likewise, He condemns those who neglect outward obligations and commit outward sins when subjected to harm and trials, as He says:
“They will not cease fighting you.”
Surah al-Baqarah, 217—to the end of the verse, as discussed above.