I think the Catechism has a helpful remark on this point: “CCC 2108 - The right to religious liberty is neither a moral license to adhere to error, nor a supposed right to error, but rather a natural right of the human person to civil liberty, i.e., immunity, within just limits, from external constraint in religious matters by political authorities. This natural right ought to be acknowledged in the juridical order of society in such a way that it constitutes a civil right.”
This part is equally important–it even cites Bl. Pius IX’s encyclical Quanta Cura’s paragraph 3:
2109 The right to religious liberty can of itself be neither unlimited nor limited only by a “public order” conceived in a positivist or naturalist manner.39 The “due limits” which are inherent in it must be determined for each social situation by political prudence, according to the requirements of the common good, and ratified by the civil authority in accordance with "legal principles which are in conformity with the objective moral order."40
39 Cf. Pius VI, Quod aliquantum (1791) 10; Pius IX, Quanta cura 3.
Per the OP, the key is to understand what was actually being addressed in each time period, because often terms are used in different ways at different times.
Bl. Pius IX was condemning proposals for absolute, unlimited liberty in matter of religion based on a foundation of religious indifferentism and states declaring man’s conscience free from any duty to God, faith, or the Church, as well as state’s uprooting and destroying long established Catholic societies to further these false principles. See for more context, Bl. John Henry Newman’s letter to Gladstone, chapters 5, 6, and 7:
newmanreader.org/Works/anglicans/volume2/gladstone/index.html
St. John Paul II, echoing the Second Vatican Council, was dealing with the other side of the coin–the arbitrary suppression of all religious activity without any reference to truth or the common good or any respect for man’s religious duties–duties which must be carried out freely.
In sum, Bl. Pius IX was dealing those who said false religious activity could never be suppressed, even if harmful to the common good and with states who affirmed as a principle that all religions are equal because “reason” should be the only governing principle of man. St. John Paul II was dealing with those who argued that religion, true or false, should always be suppressed, even if it is not harmful to an authentic understanding of the common good and declaring that man must not acknowledge God at all, at least not in any public capacity.
It should also be noted the Church spent a lot of the 18th and 19th centuries fighting against false theories of human rights. But beginning with Leo XIII, and especially Pius XI, Pius XII, and St. John XXIII, the Church developed in a positive way an authentic doctrine of human rights to counter the false ones, rather than simply issuing condemnations.