The G23 and G35 have the universal handgun rail, which is different than a Picatinny rail (which is also different from a Weaver rail). Sometimes you can get a light with a Picatinny rail to fit a universal rail (or vice-versa), but the switch rarely makes the proper index at or around the trigger guard.
So, what is the specific light in question?