What encyclical upheld God's sovereignty over the regularity of natural laws? Somewhere in my readings (I forget exactly where) I came across the following chain of events:

The Philosophy of Aristotle regarding the regularity of science --- scientific laws can be relied upon for future predictions --- acquired acceptance in the Catholic Church thanks to St. Thomas Aquinas.
The philosophy of St. Thomas Aquinas acquired great deference, to the point of being mentioned very favorably in a council decree.
Science gained prominence as a reliable explanation of many aspects of the world.
Someone(?) proposed that God had setup the material world to obey the scientific laws, and that therefore those laws could not be violated, even by God.
Against this, the Pope of the time issued some kind of document saying that God is sovereign, and is not Himself bound by the regular laws he established for nature, and that therefore He is free to act independent of these laws in specific instances (or to abrogate them entirely?).

I am looking for the name of the encyclical (or other similar document) mentioned in (5).  Hopefully someone will have its name.
Thanks!
Pope Pius IX, First Vatican Council, dogmatic constitution Dei Filius on faith &amp; reason, canons on God the Creator of all things:

Canon 5. If any one confess not that the world, and all things which are contained in it, both spiritual and material, have been, in their whole substance, produced by God out of nothing; or shall say that God created, not by his will, free from all necessity, but by a necessity equal to the necessity whereby he loves himself [e.g., a logical necessity]; or shall deny that the world was made for the glory of God: let him be anathema.

Cf. also Pope St. Pius X, Pascendi Dominici Gregis ¶¶16-17.

Addressing your specific questions:
Yes, St. Thomas Aquinas's philosophy and theology has great authority in the Catholic Church, as testified by numerous popes; his Summa Theologica was even placed on the altar, alongside the Bible, at the Council of Trent!
The notion of a physical law is explained very well in ch. 10 &quot;Physical Laws&quot; of The Physical System of St. Thomas (1893) by G. M. Cornoldi, S.J.
The Catholic physicist Pierre Duhem (1861-1916) describes modern physics's narrower conception of &quot;physical law&quot; in Aim &amp; Structure of Physical Theory (La théorie physique: Son objet, sa structure 1906) pt. 2, ch. 4.On how more modern philosophers of science conceive physical laws, cf. Aristotle's Revenge (2018), §3.3 &quot;How the laws of nature lie (or at least engage in mental reservation)&quot; by Thomist philosopher Ed Feser.
Neither definition turns the laws of physics into logical necessities. God is free to create however He chooses (as long as it does not imply a contradiction); cf. Summa Contra Gentiles II ch. 23 &quot;That God does not act by natural necessity&quot;.
Ancient Greek philosophers didn't distinguish theology from natural philosophy, thinking that the universe was an extension of God (pantheism). This led to believing that the universe (and its laws) could only be one way. Catholics believe that God and the universe are distinct, so theology (the study of God) and natural philosophy (the study of the physical world) are distinct disciplines, too; this freed ancient thought from its closed-minded dogmatism, enabling science to progress and not be &quot;stillborn&quot; (as physicist and theologian Stanley L. Jaki, O.S.B. calls pre-Christian-era science in Savior of Science).
See also Fr. Jaki's Miracles &amp; Physics and St. Thomas's Summa Contra Gentiles, lib. 3 cap. 101 on the three types of miracles, miracles being &quot;works that are sometimes done by God outside the usual order assigned to things&quot;.