Once again the two voice texture makes things less obvious. If you look at the first complete measure after the repeat, you have an A7 chord. It's missing the 5th (E) but you have A, C#, and G natural. That's the V7 of D major (like the V/IV you wrote). What's happening in the next measure is the the A7 resolves to D, but there is a suspension (the soprano G) which resolves to F# on the second beat. So you should not really think of that G over a D in the bass being a G major chord that's missing the third (the B). Rather, if all the voices were there (ie if the missing fifth of the chord were present), it would be DGA resolving to DF#A, an extremely common kind of suspension and resolution.
Speaking of suspensions and brogers comment, I would view the second beat in bars 9 and 24 as a suspension in the function that is on beat 3. I.e. in bar 9 both beat 2 and 3 are the V/V, but beat 2 is a suspension. In bar 24 both beat 2 and 3 are the V, but beat 2 is a suspension. I'd personally think of these two examples as cadential 6-4 to 5-3, except there is no 6 and 5 https://www.schoolofcomposition.com/understanding-the-cadential-6-4/