Stoning married adulterers is a revelation from Allah ﷻ. This is why the Prophet ﷺ and his companions did so. The verses you quoted on flogging refer to unmarried adulterers.
In the khutba of a Friday prayer, 'Umar ibn Al-Khattab responded to your question:
حَدَّثَنِي أَبُو الطَّاهِرِ، وَحَرْمَلَةُ بْنُ يَحْيَى، قَالاَ حَدَّثَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، قَالَ أَخْبَرَنِي عُبَيْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ بْنِ عُتْبَةَ، أَنَّهُ سَمِعَ عَبْدَ اللَّهِ بْنَ عَبَّاسٍ، يَقُولُ قَالَ عُمَرُ بْنُ الْخَطَّابِ وَهُوَ جَالِسٌ عَلَى مِنْبَرِ رَسُولِ اللَّهِ صلى الله عليه وسلم إِنَّ اللَّهَ قَدْ بَعَثَ مُحَمَّدًا صلى الله عليه وسلم بِالْحَقِّ وَأَنْزَلَ عَلَيْهِ الْكِتَابَ فَكَانَ مِمَّا أُنْزِلَ عَلَيْهِ آيَةُ الرَّجْمِ قَرَأْنَاهَا وَوَعَيْنَاهَا وَعَقَلْنَاهَا فَرَجَمَ رَسُولُ اللَّهِ صلى الله عليه وسلم وَرَجَمْنَا بَعْدَهُ فَأَخْشَى إِنْ طَالَ بِالنَّاسِ زَمَانٌ أَنْ يَقُولَ قَائِلٌ مَا نَجِدُ الرَّجْمَ فِي كِتَابِ اللَّهِ فَيَضِلُّوا بِتَرْكِ فَرِيضَةٍ أَنْزَلَهَا اللَّهُ وَإِنَّ الرَّجْمَ فِي كِتَابِ اللَّهِ حَقٌّ عَلَى مَنْ زَنَى إِذَا أَحْصَنَ مِنَ الرِّجَالِ وَالنِّسَاءِ إِذَا قَامَتِ الْبَيِّنَةُ أَوْ كَانَ الْحَبَلُ أَوْ الاِعْتِرَافُ
'Abdullah b. 'Abbas reported that 'Umar b. Khattab sat on the pulpit of Allah's Messenger (ﷺ) and said: Verily Allah sent Muhammad (ﷺ) with truth and He sent down the Book upon him, and the verse of stoning was included in what was sent down to him. We recited it, retained it in our memory and understood it. Allah's Messenger (ﷺ) awarded the punishment of stoning to death (to the married adulterer and adulteress) and, after him, we also awarded the punishment of stoning, I am afraid that with the lapse of time, the people (may forget it) and may say: We do not find the punishment of stoning in the Book of Allah, and thus go astray by abandoning this duty prescribed by Allah. Stoning is a duty laid down in Allah's Book for married men and women who commit adultery when proof is established, or it there is pregnancy, or a confession.
— Sahih Muslim » The Book of Legal Punishments » Hadith 1691 a
In this hadith (attributed to 'Umar and not to the Prophet ﷺ), which was documented in several other books of hadith (e.g., Sahih Al-Bukhari, Al-Sunan Al-Kubra by Al-Nasa'i, Al-Sunan Al-Kubra by Al-Baihaqi, Sunan Ibn Majah, Musnad Abi Ya'la, Musnad Ahamd ibn Hanbal, Musnad Al-Humaidi, Musannaf Abi Shaiba, Al-Mustadrak, and others), 'Umar is predicting (and it is possible that this was based on something that 'Umar heard from the Prophet ﷺ) there would come a time when people would question the ruling of stoning adulterers. He added that it was revealed in the Qur'an, and that it was practiced by the Prophet ﷺ, and by his companions after him. The verse in the Qur'an was abrogated in recitation but not in ruling. This is also confirmed by 'A'isha bint Abu Bakr:
حَدَّثَنَا أَبُو سَلَمَةَ، يَحْيَى بْنُ خَلَفٍ حَدَّثَنَا عَبْدُ الأَعْلَى، عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي بَكْرٍ، عَنْ عَمْرَةَ، عَنْ عَائِشَةَ، . وَعَنْ عَبْدِ الرَّحْمَنِ بْنِ الْقَاسِمِ، عَنْ أَبِيهِ، عَنْ عَائِشَةَ، قَالَتْ لَقَدْ نَزَلَتْ آيَةُ الرَّجْمِ وَرَضَاعَةُ الْكَبِيرِ عَشْرًا وَلَقَدْ كَانَ فِي صَحِيفَةٍ تَحْتَ سَرِيرِي فَلَمَّا مَاتَ رَسُولُ اللَّهِ ﷺ وَتَشَاغَلْنَا بِمَوْتِهِ دَخَلَ دَاجِنٌ فَأَكَلَهَا
It was narrated that 'Aishah said: "The Verse of stoning and of breastfeeding an adult ten times was revealed, and the paper was with me under my pillow. When the Messenger of Allah ﷺ died, we were preoccupied with his death, and a tame sheep came in and ate it."
— Sunan Ibn Majah » Marriage » Hadith 1944
In Fat'h Al-Bari (Arabic: فتح الباري شرح صحيح البخاري) by Ibn Hajar al-Asqalani (Arabic: أحمد بن علي بن حجر العسقلاني), in the chapter on stoning adulters, Ibn Hajar mentioned the story when Al-Sha'bi discussed 'Ali's decision to stone an adulterer, It goes to show that the ruling applies only to married people, who have established a proper marriage (i.e., entered into a valid marriage contract and consummated their marriage). It further explains that this ruling came directly from the Prophet:
وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى التَّمِيمِيُّ، أَخْبَرَنَا هُشَيْمٌ، عَنْ مَنْصُورٍ، عَنِ الْحَسَنِ، عَنْ حِطَّانَ، بْنِ عَبْدِ اللَّهِ الرَّقَاشِيِّ عَنْ عُبَادَةَ بْنِ الصَّامِتِ، قَالَ قَالَ رَسُولُ اللَّهِ ﷺ: خُذُوا عَنِّي خُذُوا عَنِّي قَدْ جَعَلَ اللَّهُ لَهُنَّ سَبِيلاً الْبِكْرُ بِالْبِكْرِ جَلْدُ مِائَةٍ وَنَفْىُ سَنَةٍ وَالثَّيِّبُ بِالثَّيِّبِ جَلْدُ مِائَةٍ وَالرَّجْمُ
'Ubada b. as-Samit reported: Allah's Messenger (ﷺ) as saying: Receive (teaching) from me, receive (teaching) from me. Allah has ordained a way for those (women). When an unmarried male commits adultery with an unmarried female (they should receive) one hundred lashes and banishment for one year. And in case of married male committing adultery with a married female, they shall receive one hundred lashes and be stoned to death.
— Sahih Muslim » Legal Punishments » Hadith 1690 a
A similar explanation of the hadith can be found in Sahih Muslim bi sharh al-Nawawi (Arabic: شرح النووي على مسلم) by Al-Nawawi (Arabic: يحيي بن شرف أبو زكريا النووي).
This basically establishes that the ruling was based on a previous verse in the Qur'an that was abrogated (hadith of 'A'ishah), and that the Prophet ﷺ did so (from the two hadiths that you quoted, and others), as did the companions (from the hadiths of 'Umar and 'Ubada). The next question is why continue with the ruling when it was abrogated from the Qur'an. This is because Qur'an is not the sole source of Shari'ah; it is both Qur'an and Sunnah:
حَدَّثَنَا عَبْدُ الْوَهَّابِ بْنُ نَجْدَةَ، حَدَّثَنَا أَبُو عَمْرِو بْنُ كَثِيرِ بْنِ دِينَارٍ، عَنْ حَرِيزِ بْنِ عُثْمَانَ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ أَبِي عَوْفٍ، عَنِ الْمِقْدَامِ بْنِ مَعْدِيكَرِبَ، عَنْ رَسُولِ اللَّهِ ﷺ أَنَّهُ قَالَ
أَلاَ إِنِّي أُوتِيتُ الْكِتَابَ وَمِثْلَهُ مَعَهُ أَلاَ يُوشِكُ رَجُلٌ شَبْعَانُ عَلَى أَرِيكَتِهِ يَقُولُ عَلَيْكُمْ بِهَذَا الْقُرْآنِ فَمَا وَجَدْتُمْ فِيهِ مِنْ حَلاَلٍ فَأَحِلُّوهُ وَمَا وَجَدْتُمْ فِيهِ مِنْ حَرَامٍ فَحَرِّمُوهُ أَلاَ لاَ يَحِلُّ لَكُمْ لَحْمُ الْحِمَارِ الأَهْلِيِّ وَلاَ كُلُّ ذِي نَابٍ مِنَ السَّبُعِ وَلاَ لُقَطَةُ مُعَاهِدٍ إِلاَّ أَنْ يَسْتَغْنِيَ عَنْهَا صَاحِبُهَا وَمَنْ نَزَلَ بِقَوْمٍ فَعَلَيْهِمْ أَنْ يَقْرُوهُ فَإِنْ لَمْ يَقْرُوهُ فَلَهُ أَنْ يُعْقِبَهُمْ بِمِثْلِ قِرَاهُ
Narrated Al-Miqdam ibn Ma'dikarib: The Prophet (ﷺ) said:
Beware! I have been given the Qur'an and something like it, yet the time is coming when a man replete on his couch will say: Keep to the Qur'an; what you find in it to be permissible treat as permissible, and what you find in it to be prohibited treat as prohibited. Beware! The domestic ass, beasts of prey with fangs, a find belonging to confederate, unless its owner does not want it, are not permissible to you If anyone comes to some people, they must entertain him, but if they do not, he has a right to mulct them to an amount equivalent to his entertainment.
— Sunan Abi Dawud » Model Behavior of the Prophet » Hadith 4604
In this hadith, the Prophet ﷺ told us that the time will come when people question hadith and want to refer only to the Qur'an. Then he explained that he was given two sources: the Qur'an and his sunnah. The Prophet ﷺ declared as halal or haram based on revelations. The Qur'an is referred to in verses as the book (al-kitab), and the sunnah is referred to as the wisdom (al-hikma), according to the majority of tafsirs. These two were mentioned in Al-Baqarah 2:129 as Ibrahim ﷺ supplicated to Allah to send from amongst them a messenger that will recite Allah's verses and teach them the book and wisdom. This was also mentioned in Al-Baqarah 2:151, and in Al-Jumu'ah 62:2 among other verses. Not only that, but Allah ﷻ emphasizes that these two sources were His revelations:
وَأَنزَلَ اللَّهُ عَلَيْكَ الْكِتَابَ وَالْحِكْمَةَ وَعَلَّمَكَ مَا لَمْ تَكُن تَعْلَمُ ۚ وَكَانَ فَضْلُ اللَّهِ عَلَيْكَ عَظِيمًا
And Allah has revealed to you the Book and wisdom and has taught you that which you did not know. And ever has the favor of Allah upon you been great.
— An-Nisa [4:113]
This establishes that the hadiths in general, including the ones related to the stoning of married adulterers in specific, when authenticated, are treated as revelations from Allah ﷻ. So, it is natural that the Prophet ﷺ and his companions followed Allah's commands, be it through the Book or through the wisdom.
Finally, the rulings related to adulterers evolved over the life of the Prophet ﷺ. Initially, women were not stoned but confined to their houses until death (see Surah An-Nisa 4:15), which was later abrogated as per the hadiths above. You may hear other views that the hadiths related to stoning of married adulterers were prior to the revelation of the verses in Surat Al-Nur. These hadiths in Sahih al-Bukhari » Limits and Punishments set by Allah » Hadiths 6815 and 6816, which refer to the stoning of an adulterer, were narrated by Abu Huraira as an event that he witnessed. Abu Huraira embraced Islam in 7 AH, whereas Surat Al-Nur was revealed 2-3 years before. Stoning of married adulterers took place by the Prophet ﷺ after the revelation of the verses you quoted.