As you say, there's verses of the Qur'an which say it's protected by Allah:
Indeed, it is We who sent down the Qur'an and indeed, We will be its guardian.
Qur'an 15:9 (see also Qur'an 41:42)
Thus, Islamic belief is that the Qur'an is accurately preserved. However, the Qur'an is fundamentally a recitation (rather than a book):
Rather, the Qur'an is distinct verses [preserved] within the breasts of those who have been given knowledge. And none reject Our verses except the wrongdoers.
For more about this, see III-AK-III's answer to The Birmingham Quran versus the present-day Quran We also know there are different readings: for examples, see Examples of verses of the Qur'an with two different readings?
IslamWeb quotes Ibn Hazm who said that Qur'an 15:9 above also applies to the sunnah (essentially, the true ahadith). He evidences that with:
Nor does he speak from [his own] inclination. It is not but a revelation revealed,
IslamWeb also mentions later scholars, Ibn Taymiyyah and Ibn Al-Qayyim, held the same opinion.
Ahadith were preserved using the same mechanism to preserve the Qur'an: oral tradition through memorization. The same narrators preserved both ahadith and the Qur'an.
An Islam Q&A fatwa arguing against Qur'an-only Islam highlights the rigor involved in preserving ahadith:
Their suggestion that the Sunnah is “contaminated” with fabricated ahaadeeth is not valid, because the scholars of this ummah took the utmost care to purify the Sunnah from all alien elements. If they had any doubts about the truthfulness of any narrator, or there was the slightest possibility that he could have forgotten something, this would be sufficient grounds for rejecting a hadeeth. Even the enemies of this ummah have stated that no other nation has paid so much attention to examining its reports and their narrators, especially in the case of reports narrated from the Messenger of Allaah (peace and blessings of Allaah be upon him).
We have the hadith sciences (ʻilm al-ḥadīth), which systematically studies and evaluates hadith. Narration chains are cross-checked with one another; and narrators are determined to be reliable or not.
Also, I feel it's an exaggeration to say ahadith are "perfectly preserved" (at least, when compared to the Qur'an). To illustrate:
Abu Hazim narrated it on the authority of Ibn Sa'd that the Messenger of Allah said: Seventy thousand persons or seven hundred thousand persons (Abu Hazim does not remember the exact number) would enter Paradise holding and supporting one another, and the first among them would not enter till the last among them would enter (therein); (they would enter simultaneously) and their faces would be bright like the full moon.
Sahih Muslim 219