The holy Roman Pontiff, Vicar of Christ and Supreme Judge of all the faithful, is the head of the Church on earth in his person, not merely in his office. He stands in persona Christi more so than any other bishop or priest. His role is not merely a job that he fulfills for a certain number of hours per week. His role is not merely a function within the Church. As Supreme Pontiff, each and every successor of Peter, in his very person, is the true head of the Church on earth.
The Church is the Ark of Salvation. For the sake of the eternal salvation of souls, Jesus has given the Church the gift of indefectibility, meaning that She can never go astray, nor can She lead the faithful astray. All claims to the contrary notwithstanding.
So if any claimed visionary prophesies, supposedly based on message from heaven, that the Church will go astray, without any doubt said visionary is a false prophet, led astray by devils. And there are many such false visionaries in the world today.
Now the Pope is the head of the Church in his person, not solely in his office. Therefore, not only can he never teach heresy under his official role as Teacher of the Church, he also cannot commit the sin of heresy in any way — neither in his private expressions, nor hidden in his heart and mind, nor in any magisterial teaching. For if the person of the Pope could teach heresy at all, or could commit the sin of heresy at all, then the head of the Church would be corrupted and the Church would not be indefectible. Therefore, by the prevenient grace of God, the Apostle Peter and all his valid successors are each entirely unable to commit the sins of apostasy, heresy, and schism and are each entirely unable to teach heresy in any way, shape, or form, at any time.
Does this restriction on each Pope, imposed by prevenient grace, contradict free will? No, it does not. For each Pope must freely accept his office, in order to be a valid Pope, and each Pope is able, at any time, to freely resign from office.
Please take a look at this list of my books and booklets, and see if any topic interests you.