Again. The verse related to stoning was not allowed to be entered into Quran by Prophet Muhammad (PBUH) himself but its ruling was applied whenever a case of adultery happened
We read in another Hadeeth:
Kathir ibn al-Salt reported: Amr ibn al-‘As and Zayd ibn Thabit would write down the Quran. They passed over this verse and Zayd said, “I heard the Messenger of Allah, peace and blessings be upon him, say: The married old man and old woman, if they commit adultery, then stone them irrevocably.” Umar said, “When this was revealed, I went to the Prophet and I said: Let me write it.” Shu’bah said, “It was as if the Prophet disliked that.” Umar said, “No doubt, you see that if an old men is unmarried he is merely flogged, while if a youth commits adultery while married is stoned.”
Source: Musnad Aḥmad 21086
So verse was not allowed to be written in Quran by Prophet (SAW) even though its ruling remained in practice and nope it was not because of any local custom