Let me begin by the observation that during his pontificate, John Paul II authoritatively taught that the Church had no authority to perform a certain action. Furthermore, he certified that this teaching was infallible via the ordinary and universal magisterium.
Now, let us suppose that it is discovered that during the Middle Ages, a bishop encountered a situation where in his opinion, a woman had an especially meritorious case for having this action applied to her. The bishop wrote to the Pope at the time, and the Pope approved of having this action applied to this particular woman.
The question: How are we to understand this? Did the medieval pope make an error in doctrine, or merely a misjudgement in the application of a practical discipline? If this was only a matter of discipline, would it be possible for a future pope to make the same disciplinary misjudgement?
Finally, did the action have its intended effect, or does the infallible teaching that the Church does not have the authority to perform this action mean that the action was invalid?
Note: I’m keeping this discussion at an abstract level for now, because I don’t want to get side-tracked with tons of details before I understand the general principles involved. Thanks!