“When he teaches heresy or falls into idolatry.”
Wrong. Popes have the charism of truth and never failing faith.
“When he errs gravely on doctrine or discipline, as in Amoris Laetitia or Traditionis Custodes.”
Wrong. The Apostolic See is unblemished by any grave error, even in discipline.
“When he deviates from the faith, that is, commits less than grave errors on doctrine or discipline.”
He can err in that manner, to that extent, but how do you know he is wrong? You don’t, and there is no way to be certain he is wrong, as even Ecumenical Councils have erred gravely, to the extent of heresy — except that the Pope intervened to refuse to approve the error.
Therefore, the Pope cannot ever by corrected by anyone but God, just as Unam Sanctam infallibly teaches — however, the faithful can “contradict” the Pope if they believe he may possibly have erred in a less than grave manner, by a theological argument, but always necessarily absent from the assumption that the Pope is certainly wrong and those who disagree are certainly right. For they do not have infallibility, so anyone “correcting” the Pope can be wrong. Thus, it is not a correction or a rebuke, but only a proposal to the judgment of the Roman Pontiff to consider a theological argument, or otherwise, to hold to one’s own contrary opinion, on a lesser matter (that does not require full assent of faith), without expecting the Pope to change his mind.
There is no correction of the Pope. Only licit theological dissent from possible lesser errors in doctrine or discipline. Whoever assumes the Pope is certainly wrong, errs by pride. Since you cannot be certain you are right, you should not call a licit dissent from papal decisions “correction” or “rebuke” but dissent. And you should always consider that the likelihood is that you are wrong. Yes, when you licitly dissent from a papal decision, you yourself should consider it most likely that you are wrong. No one opposes the Pope to his face, other than heretics.
Paul corrected Peter for a personal error, which may or may not have had the culpability of a sin. Paul was not correcting Peter for a teaching or decision on discipline to the Church.