Just look at the definition of law and theory in any science textbook!
I would say your textbooks are way out of date. I stand my my statement that the law of gravity is what happens and the theory of gravity is why.
Actually Newton’s law of gravity formula has been shown to not stand up under extreme conditions in space, so I would say that even it does not qualify as an infallible law. It works ok for classical physics, but not so well if we want to study the whole universe from the sub particle to the far reaches of space.
The study of sub particle physics and string theory are bringing us closer to understanding what gravity really is, but they are still theories.