All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The scholars defined the Ijmaa’ (consensus) to be the agreement of the eminent scholars who are known for their outstanding ability to deduct rulings from the Book of Allaah and the Sunnah of the Prophet at a particular time on a particular issue.
Undoubtedly, the agreement of the four Imaams does not correspond to the above definition so it cannot be considered a consensus.
However, if a consensus is proven, it becomes evidence because the Muslim scholars cannot collectively agree on something wrong. Indeed, the scholars of Usool Al-Fiqh (the principles of Fiqh) stated that there is no consensus on a particular issue except that it has an evidence and reference in the Book of Allaah and the Sunnah of the Prophet .
Allaah Knows best.