Where there is no logic, there can be no logical fallacy.
"Gravity is only a theory" is simply a statement. It might be understood by a listener in a different way than intended by the speaker, but it is not logically fallacious.
1. To be blue is to be sad.
2. The sky is blue.
Therefore, the sky is sad.
This is logically fallacious since "blue" is being used to draw a conclusion about the sky, but the two premises use two different meanings of the word ("blue" as in sad; "blue" as in color).
If someone simply said "the sky is blue", this would not be a logical fallacy. One listener might hear it as "the sky is [the color] blue" and another listener might hear it as "the sky is sad", but there would be no logical fallacy on the part of the speaker.