There are numerous terms that have well-defined meanings in science. It just so happens that ‘theory’ and ‘fact’ aren’t among them.
Here I think you’re missing an important distinction w/r/t the use of ‘theory’ that scientists (especially physicists) make, even if it’s usually unconsciously. That is the difference between ‘theory’ and ‘a theory’. The former refers to machinery, usually mathematical, for describing phenomena and not to a particular model and comes directly from math (set theory, number theory). String theory and quantum field theory are theory in this sense, as are other frameworks for calculation (effective heavy quark theory, lattice gauge theory) that are known to be approximations. A theory, on the other hand, is a specific model that is intended to describe specific phenomena. Thus, quantum electrodynamics is a theory that employs the framework of quantum field theory. As you move away from physics the distinction becomes murkier, e.g. the neutral theory of evolution includes both the machinery for calculating how neutral allele frequencies change and the specific claim that most molecular evolution is neutral.
The problem is that the textbook is simply wrong – and not just the textbook, since I’ve seen a similar statement from the US National Academy of Science. Nowhere have I seen any evidence that scientists actually employ this definition. There are plenty of technical terms in science that have clear definitions. You can tell what they are because if you use them incorrectly as a scientist, you’ll be corrected. If you use ‘significant’ or ‘confidence’ incorrectly in a paper, a reviewer will point out the mistake and you can find numerous papers and blog entries and tweets describing the correct usage and lambasting those who use them incorrectly. None of that happens with ‘theory’: it’s not taught, ‘mistakes’ aren’t corrected, and multiple meanings flourish. Go search on Google Scholar for “supersymmetric theories” (with quotes) and you’ll find tens of thousands of hits, even though there is zero evidence for any supersymmetric theory. This supposed scientific definition of theory is simply a myth that gets passed around among scientists, mostly when addressing anti-evolutionists.