All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
The hadeeth that you mentioned is false. Ibn Hibbaan said about it, “It is false and there is no basis for it.” Besides, Ibn Al-Jawzi ruled that it is fabricated, and Al-Albaani supported their view in As-Silsilah Adh-Dha‘eefah. Please, refer to fatwa 92268.
As regards the existence of such a hadeeth in a book, then this does not necessitate forbidding printing the book and its publication.
Most of the books of heritage are hardly devoid of shortcomings like the mention of such invalid ahaadeeth. Nevertheless, these books continued to circulate among the scholars throughout the ages, and we have not heard of any scholar who forbade copying the books or printing them or selling them.
What is forbidden to sell and publish are the books of false sciences.
An-Nawawi said, “Our scholars said that it is not permissible to sell the books of Kufr (disbelief), as they do not have any permissible benefit; rather, they must be destroyed. The same applies to books on astrology, sorcery, philosophy, and other false and forbidden sciences; so selling them is invalid because there is no permissible benefit in them.”
Allah knows best.