could be a leak somewhere, most likely it's a problem with your octave mechanism seeing as it only happens on G2/ G#2 .
I would first check your octave mech to ensure that when you play your G with the octave key pressed, the body octave key is open and the octave key on the crook is fully closed and the pad is sealing on the octave pip. ( it should be the reverse when you play an A e.g. body pip closed and crook key open)
check also that you have some clearance between the loop on the crook key and the arm that operates it .
seeing as we're in the beginners section of the forum, it could be that its your embouchure/mouthpiece or reed causing this .