The criteria for the Pope's actually being immune from error are well established, and are set out by Vatican I in its dogmatic constitution Pastor Aeternus. An infallible papal definition involves three things: the pope must exercise his authority as successor of Peter in teaching; his teaching must be stated as a matter that concerns faith or morals; and he must assert that his teaching is a final decision that binds the whole Church to believe in its contents upon pain of sin against faith.
In contrast, the formula for the canonisation of John XXIII and John Paul II (substantially the same as the formulas used in earlier canonisations) is as follows:
For the honour of the blessed Trinity, the exaltation of the Catholic faith and the increase of the Christian life, by the authority of our Lord Jesus Christ and of the holy Apostles Peter and Paul and our own, after due deliberation and frequent prayer for divine assistance, and having sought the counsel of many of our brother bishops, we declare and define blessed John XXII and John Paul II to be saints, and we enrol them among the saints, decreeing that they are to be venerated as such by the whole Church, in the name of the Father and of the Son and of the Holy Spirit.
Veneration is a matter of faith, the authority of the chair of St. Peter is clearly called upon to declare it, and the whole Church is ordered to follow it. That hits every criterion.
Furthermore, the belief that canonisations are infallible has been one that the Popes, Bishops, Doctors of the Church and Saints(but who knows who's a Saint according to you) have taught in unity for all of Church history. We are required to believe such teachings - that is what the universal magisterium is. There has never been any question of it until John XXIII's canonisation made loons like you change their tune overnight.