This is not correct.
Gravity is a function of everything that has energy (see the stress energy tensor). It’s a very unusual “force” in this regard. This leads to interesting situations like a perfectly mirrored box of light (if you could have such a thing) weighing more on a scale than a box without light in it. Also, a spinning cue ball or a compressed spring weigh more than a stationary ball and an uncompressed spring. Granted, these differences are so small as to be undetectable by any equipment we could ever build, but it’s still interesting to think about.