That's likely malpractice. The provisions relating to when taxes are eligible for discharge are provided in the bankruptcy code, not the tax code, and the bankruptcy lawyer should be familiar with that; that's within his/her area of practice. The bankruptcy attorney just needs to gather the right facts — the dates the returns were filed and the dates of assessment of the taxes owed when the debt is income tax. To the extent that there is any uncertainty over those facts the bankruptcy lawyer should know to consult a tax lawyer or other tax expert. So I see that as a pretty egregious error by the bankruptcy attorney unless either his client failed to tell him of the tax liability or there was some more important consideration that dictated when the petition had to be filed.
This is unlike the situation I often see in family law matters where the family law attorney just isn't even aware of the tax issues because it's outside his/her area of practice. That, too, might still amount to malpractice, but isn't quite as blatant a screw up, IMO.