If the Pope were to teach grave error or heresy, which lawful authority can declare this and what would be the consequences?

It is the duty in such cases, and historically it has happened, of cardinals and bishops to make clear that the Pope is teaching error and to ask him to correct it.

The Prefect of the Sacred Congregation for the Doctrine of the Faith has this judgment of A.L.;


Cardinal Müller says,

Amoris Laetitia is very clear in its doctrine and we can interpret the whole doctrine of Jesus on marriage, the whole doctrine of the Church in 2000 years of history.” Pope Francis, the cardinal concluded, “asks us to discern the situation of these people who live in an irregular union, one not according to the Church’s teaching on marriage, and asks us to help these people find a way towards reintegration into the Church according to the conditions of the sacraments, the Christian message of marriage. But I do not see any opposition: on the one hand we have the clear teaching on marriage, on the other hand the obligation of the Church to care for these people in need.”
http://www.catholicnewsagency.com/news/cardinal-mueller-theres-no-problem-with-doctrine-in-amoris-laetitia-99386/


Vatican I

Chapter 2. 

On the permanence of the primacy of blessed Peter in the Roman pontiffs


1. That which our lord Jesus Christ, the prince of shepherds and great shepherd of the sheep, established in the blessed apostle Peter, for the continual salvation and permanent benefit of the Church, must of necessity remain for ever, by Christ's authority, in the Church which, founded as it is upon a rock, will stand firm until the end of time [45].

2. For no one can be in doubt, indeed it was known in every age that the holy and most blessed Peter, prince and head of the apostles, the pillar of faith and the foundation of the Catholic Church, received the keys of the kingdom from our lord Jesus Christ, the savior and redeemer of the human race, and that to this day and for ever he lives and presides and exercises judgment in his successors the bishops of the Holy Roman See, which he founded and consecrated with his blood [46].

3. Therefore whoever succeeds to the chair of Peter obtains by the institution of Christ himself, the primacy of Peter over the whole Church. So what the truth has ordained stands firm, and blessed Peter perseveres in the rock-like strength he was granted, and does not abandon that guidance of the Church which he once received [47].

4. For this reason it has always been necessary for every Church--that is to say the faithful throughout the world--to be in agreement with the Roman Church because of its more effective leadership. In consequence of being joined, as members to head, with that see, from which the rights of sacred communion flow to all, they will grow together into the structure of a single body [48].

5. Therefore, if anyone says that it is not by the institution of Christ the lord himself (that is to say, by divine law) that blessed Peter should have perpetual successors in the primacy over the whole Church; or that the Roman Pontiff is not the successor of blessed Peter in this primacy: let him be anathema.

Chapter 3. 

On the power and character of the primacy of the Roman Pontiff


1. And so, supported by the clear witness of Holy Scripture, and adhering to the manifest and explicit decrees both of our predecessors the Roman Pontiffs and of general councils, we promulgate anew the definition of the ecumenical Council of Florence [49], which must be believed by all faithful Christians, namely that the Apostolic See and the Roman Pontiff hold a world-wide primacy, and that the Roman Pontiff is the successor of blessed Peter, the prince of the apostles, true vicar of Christ, head of the whole Church and father and teacher of all Christian people.

To him, in blessed Peter, full power has been given by our lord Jesus Christ to tend, rule and govern the universal Church.

All this is to be found in the acts of the ecumenical councils and the sacred canons.

2. Wherefore we teach and declare that, by divine ordinance, the Roman Church possesses a pre-eminence of ordinary power over every other Church, and that this jurisdictional power of the Roman Pontiff is both episcopal and immediate. Both clergy and faithful, of whatever rite and dignity, both singly and collectively, are bound to submit to this power by the duty of hierarchical subordination and true obedience, and this not only in matters concerning faith and morals, but also in those which regard the discipline and government of the Church throughout the world.

3. In this way, by unity with the Roman Pontiff in communion and in profession of the same faith , the Church of Christ becomes one flock under one Supreme Shepherd [50].

4. This is the teaching of the Catholic truth, and no one can depart from it without endangering his faith and salvation.

ABS begins his brief commentary by confessing that his Catholic knowledge is as substantially lacking as it is obviously deficient but even he can see these Dogmatic Truths place Raymond Leo Cardinal Burke in very deep water.

In A.L. Franciscus publicly professes the truth of Catholic Dogma and so he can in no way be labeled a heretic.

There can be disagreement over what he has actualised vis a vis sacramental discipline but he has the authority to do that and we must obey.

Sure, there does seem to be disagreement over what A.L. means precisely within the discipline but that ought not to have caused certain Cardinals to sound the tocsin with a Dubia and then to make the Dubia public for Franciscus has made it clear he wants authority to devolve back to the Bishoprics when it comes to discipline, among other matters.

Now agree or disagree with that but to make war over discipline is to invite internecine war into an already divided Church.

The ABS ecclesiastical book is laying 4- 1 odds that Burke and his friends sink bigly in their war of choice.