I think you're majorly confused. The topics of Papal infallibility and the Inquisition have practically nothing to do with one another.
And the worst of the Inquisitions, the Spanish, ran afoul of the Papacy many times. It was more a creature of the Spanish government than of the Papacy. In fact, when the Spaniards finally shut it down in the early 19th C., they didn't even bother to ask Rome for permission!