If Unown G is attached to the Active Pokemon, then it prevents the effect of switching (as it affects both the Active Pokemon and the selected Benched Pokemon). So the switch would fail in this case.
There was a debate about this at Worlds when the situation came up in a game involving a Japanese player (possibly Yamato), but as of this writing no rulings changes have been announced, so judges should be continuing to rule as stated above.