The function of a chord largely depends on the context in which it is presented. I am going to assume that your comments are with respect to the key of G as it was the example that you used.
You are correct, in root position the chord would be: D F# A C E. Going to a "D7" on the guitar would be removing the 9th from the chord, thus you would have: D F# A C. If you were to go to a piano and play these chords, you would find them nearly identical - and you should, since it's literally almost exactly the same chord. Proceeding to a G major chord yields an authentic cadence.
From this point onward, I disagree with your statements. A progression of D7(9), D7, G does not sound functionally identical to C, D7, G or Am, D7, G progression.
From a roman numeral standpoint, the first progression would be: IV-V7-I
The second progression would be: ii-V7-I.
Let's compare the chords side-by-side:
As you can see, the C major triad shares two notes with D7(9), and the A minor triad shares three notes.
So why the confusion?
The answer I believe is two-fold:
Because the C major shares two notes, it can be used as a pivot chord from the D7(9). This would be useful for creating a plagal cadence in G major (IV-I). In which case, the chord could be re-categorized as a Cadd9(#11,13) chord instead, but this is very fussy. Speaking in a strictly chordal sense, implied harmony is the sense of harmonic motion (either progression or regression) through the use of either upper-tertian harmony or substituted chords. It is most often used in the harmonization of melodies; where the construction of a melody may imply certain harmonic realizations and cadences. This is of course in part contributed to by the expectations of listeners.
- It is the way you are voicing the chords.
If you voiced the chord such that the "E" was the top note (like you did in your question) and then proceeded to a D7 chord (assuming you are using the standard 1st position guitar voicing - putting the "F#" on the highest string - then you would have the sound of the leading tone. The reason why the "F#" from the voicing of the D7(9) doesn't suggest a cadence so strongly is for a couple of reasons: 1.) the harmony is more rich, and 2.) it is displaced by a couple octaves relative to the top string. Notes that are farther apart sound less dissonant.
In summation: I think you are being tricked by the extended harmony and your own voicings of the chords.
Addendum: In order for the original chord to serve as a sub-dominant, it would need to be followed by an E7 chord (E, G#, B, D) which would then of course resolve to A major.
Also, I strongly disagree that the D7(9) would bee seen as a polytonal chord. That term is used for harmonies that are typically non-diatonic. For example, if you played "F#" | "E" major.
Hope this helps.
{Edit} - It should also be noted that the crux of this answer is to address the aural confusion related to hearing a V7 as a IV chord in a simple functional harmonic progression.