Praise be to Allah.
The followers of the madhhabs are not all the same. Some of them are mujtahids within their madhhab, and some are followers (muqallids) who do not go against their madhhabs in any regard.
Al-Buwayti, al-Muzani, al-Nawawi and Ibn Hajr were followers of Imam al-Shaafa’i, but they were also mujtahids in their own right and differed with their imam when they had evidence. Similarly Ibn ‘Abd al-Barr was a Maaliki but he differed with Maalik if the correct view was held by someone else. The same may be said of the Hanafi imams such as Abu Yoosuf and Muhammad al-Shaybaani, and the Hanbali imams such as Ibn Qudaamah, Ibn Muflih and others.
The fact that a student studied with a madhhab does not mean that he cannot go beyond it if he finds sound evidence elsewhere; the only one who stubbornly clings to a particular madhhab (regardless of the evidence) is one who lacking in religious commitment and intellect, or he is doing that because of partisan attachment to his madhhab.
The advice of the leading imams is that students should acquire knowledge from where they acquired it, and they should ignore the words of their imams if they go against the hadeeth of the Prophet SAWS (peace and blessings of Allaah be upon him).
Abu Haneefah said: “This is my opinion, but if there comes someone whose opinion is better than mine, then accept that.” Maalik said: “I am only human, I may be right or I may be wrong, so measure my words by the Qur’aan and Sunnah.” Al-Shaafa’i said: “If the hadeeth is saheeh, then ignore my words. If you see well established evidence, then this is my view.” Imam Ahmad said: “Do not follow me blindly, and do not follow Maalik or al-Shaafa’i or al-Thawri blindly. Learn as we have learned.” And he said, “Do not follow men blindly with regard to your religion, for they can never be safe from error.”
No one has the right to follow an imam blindly and never accept anything but his worlds. Rather what he must do is accept that which is in accordance with the truth, whether it is from his imam or anyone else.
Shaykh al-Islam Ibn Taymiyah said:
No one has to blindly follow any particular man in all that he enjoins or forbids or recommends, apart from the Messenger of Allaah (peace and blessings of Allaah be upon him). The Muslims should always refer their questions to the Muslim scholars, following this one sometimes and that one sometimes. If the follower decides to follow the view of an imam with regard to a particular matter which he thinks is better for his religious commitment or is more correct etc, that is permissible according to the majority of Muslim scholars, and neither Abu Haneefah, Maalik, al-Shaafa’i or Ahmad said that this was forbidden.
Majmoo’ al-Fataawa, 23/382.
Shaykh Sulaymaan ibn ‘Abd-Allaah (may Allaah have mercy on him) said:
Rather what the believer must do, if the Book of Allaah and the Sunnah of His Messenger (peace and blessings of Allaah be upon him) have reached him and he understands them with regard to any matter, is to act in accordance with them, no matter who he may be disagreeing with. This is what our Lord and our Prophet (peace and blessings of Allaah be upon him) have enjoined upon us, and all the scholars are unanimously agreed on that, apart from the ignorant blind followers and the hard-hearted. Such people are not scholars.
Tayseer al-‘Azeez al-Hameed, p. 546
Based on this, there is nothing wrong with a Muslim being a follower of a certain madhhab, but if it becomes clear to him that the truth (concerning a given matter) is different from the view of his madhhab, then he must follow the truth.
With regard to Ibn Hazm, he was an imam and a mujtahid, and he regarded blind following as haraam. He was not a follower of any of the imams, neither Imam Ahmad nor any other imam. Rather he was the imam of ahl al-zaahir (the Zaahiris or literalists) during his own time and until now. Perhaps the view that he was a follower of Imam Ahmad (if this report is true) has to do with matters of aqeedah and Tawheed, even though he held different opinions and reckless views with regard to issues pertaining to the divine names and attributes.
See his biography in Siyar A’laam al-Nubala’, 18/184-212
And Allaah knows best.