5th Suite in C minor BWV 1011
5th Suite is played with cello whose 1st string is tuned in G; whole tone lower to normal tuning (A). Such tuning is called Scordatura in Italian.
Its advantage is to be able to play the chords of C minor easily. But to write the note is complicated.
Only the notes for 1st string are written whole tone higher. So c (real note) is written as d. But the notes for other strings are written normally. So sometimes it is not clear that the notes of higher a or b are for 1st string (G) or 2nd string (D).
So we had mistaken this note (1st note of bar 170) .
From the copy of Anna Magdalena Bach:
For a long time, we had considered this note is g (real note) for open 1st string. But it is a mistake. It is a-natural (real note) for 2nd string. Because from next bar, we hear lower pedal point of dominant (G), it is strange to hear the same note before. It must be secondary dominant (dominant of dominant / Doppeldominante) chord like previous bar (bar 169).
Yes, indeed, in the arrangement for lute, Bach uses dominant of dominant chord during 2 bars.
From bar 167:
Transposed into C minor (from bar 166):
Bach added the bass notes that don't exist in the Cello Suite, therefore, he had changed the 1st note of bar 170, but the chord is no doubt dominant of dominant.
And if this note is g, it is the same as bar 167 (3 bars before), why did Bach write these notes differently? There is no reason to use different string in the bar 167 and bar 170. It is natural to use 2nd string for the 1st notes from bar 166 to bar 170.
This note is no doubt a-natural (real note) for 2nd string. Of course if you play the 5th Suite with normal tuned cello, you can play this note with open A-string.