I think it's important that you specified...
...built on the same root
...and that you acknowledge...
...This goes entirely against my intuition, especially because of their respective major and minor thirds.
...because they don't sound interchangeable to me.
But, what similarity could we find?
First, let's take your specific voicings. The can both be seen as two pairs of similar intervals...
G B F A
...two major thirds separated by a minor seventh.
G D F Bb
...two perfect intervals separated by a minor seventh. Unlike the
G9 they aren't the exact same interval, but they are both perfect and of course the perfect fifth and perfect fourths are inversions of each other.
So both chords in these voicings are a sort of composite of two exact or similar/inverted intervals.
But, I think there is a more interesting similarity.
If the fifth of
G9 is sort of swapped for the third of
Gm7 there is similar combination of intervals between the two chords...
Root G -----|
7th F \ P4
5th D /----|
Root G / P4
7th F -----|
...if we disregard the specific chord tone identities those two are an inverted pairs. Of course when the chord tones are considered the third is absent from the
G9 group, so it's sort of a 'cheat' to say this makes the chords interchangeable.
If you omit the third from
G9, you can compare voicings like
G D A (omit B) F and
G D Bb F where there is a similar stacking of perfect fifths.
The similarities of the intervals and inversions above of course are dependent on the specific voicings. If the voicings are changed, I think you will loose the possible similarities.
From a harmonic voice leading perspective the move of scale degree
MA for minor) is fundamental to define the tonal center, the key. Basically,
^4 resolves to
^3 especially when
^4 is part of a dominant chord.
Maybe if the harmony style somehow avoids the tonal resolution to the third - or if the harmony switched between the major and minor third in an ambiguous way - these two chords could be interchangeable.