The Wikipedia article on Shafi'i says:
He also argued that sunnah contradicting the Qur'an were unacceptable, claiming that sunnah should only be used to explain the Quran.
This implies that every hadith must have its roots in the Qur'an. This makes sense to me. It naturally raises the question I asked i.e. Under which Quranic injunction the hadith to kill apostates could be classified?
The Hadith I am referring to is Sahih Bukhari Volume 9, Book 84 (Dealing with Apostates), Number 57
Volume 9, Book 84, Number 57 :
Narrated by 'Ikrima
Some Zanadiqa (atheists) were brought to 'Ali and he burnt them. The news of this event, reached Ibn 'Abbas who said, "If I had been in his place, I would not have burnt them, as Allah's Apostle forbade it, saying, 'Do not punish anybody with Allah's punishment (fire).' I would have killed them according to the statement of Allah's Apostle, 'Whoever changed his Islamic religion, then kill him.'"