Seems like a different situation though … because if an inspired prophet/writer HAD written error, the Church,** guided by the Holy Spirit**, would simply *not *have included it in the Bible. There was not a set rule already in place that whatever they wrote would be taken as inerrant - it was only later identified as such. But the pope is already in a position where his teachings on faith and morals must be infallible, unless I am misunderstanding.
The Pope is also guided by the Holy Spirit. I doubt your friend will buy the, “the Church, guided by the Holy Spirit…” Maybe he/she would?

If they did though I would wonder why they were not Catholic.
It is an interesting theological question. I would handle it like this; it runs into the same sort of problems that some other, ‘interesting theological questions’ run into such as, ‘could God create something that was so heavy he could not lift?’ The inability of the Pope, who speaks infallibly (on faith and morals), to speak error has nothing, really, to do with free will. Being infallible and having the ability to speak error (in faith and morals) is a contradiction. It limits free will no more than my inability to transform into an elephant limits my free will. Is my inability to turn into an elephant limiting to my free will? Even if I really wanted to be an elephant?
The Pope is either infallible or he isn’t. That is where the discussion should be. If he is infallible then speaking error is not an affront to his free will, as if he could speak error he would not be infallible. Again, it is a contradiction and like Frand Sheed once said, “a contradiction is nothing and nothing is impossible to God”
You could also go another route, though I am not certain how correct I am here. The Pope, when speaking infallibly, doesn’t so much limit his free will to speak error but speaks the will of God, “he who hears you, hears me…” Lk 10:16 “When the Spirit of truth comes, he will guide you into all the truth…” Jn 16:13
I am less sure on the second part and would therefore probably tackle it with my first suggestion. But that is me.
God bless you