Despite Father Anastasios' observation, St. Maximos did defend the orthodoxy of Pope Honorius. I would also like to point out that anathemas against persons are not infallible (i.e., they can be in error), and only anathemas against doctrines are infallible.
If that is the case, then St Maximus was wrong on Honorius; an ecumenical council outranks St Maximus, and an ecumenical council outranks any bishop, such as a Pope or Patriarch, as well.
Could you please clarify what you mean about anathemas and infallibility? It's an interesting point you are making.