The original idea of never take the b pawn with your queen (although I don't recall actually seeing this here or anywhere) was meant as follows:
You don't want to waste time in the OPENING trying to round up stray pawns when development is at stake.
The g pawn and b pawn comparison is similar. The only problem is that you have no way to gain time on the intruding queen in your position. In fact, you have to follow up your pawn sacrifice with a queen trade. This gives him the opportunity to get ahead in material AND simplify. With less pieces on the board, he is in less danger of being attacked.
This is a general principle that you really can't use a lot of the time.
The one exception to pawn grabbing in the opening is center pawns. A center pawn is worth losing a little time, but that is a very close call too.
Here is a good example of where sacrificing the g pawn for development is worth it:
Black has just played Qc7 and now grabbing the g pawn will cost white a lot of time.
Here is a playthrough of the variation:
Black will castle queenside, attack on the queenside, and white's king really doesn't have a great spot to go. The position is very double edged, but I was just trying to illustrate how black can get some stuff going for the sacrifice.
Edit: Note black's trumps.
He has more pieces developed.
His rook is really actively placed (on an open file).
His king will get to safety faster.
White will lose time retreating his queen later (to get her back into the game).