The X4 is an X3 with a falling roof, and as far back as the A-pillar the two are the same car: nose, bonnet, front wings and front doors are identical parts. For headlights that means a G01 is as good a source as a G02.
What matters more than the model on these units is the specification. The G02 was sold with halogen, with adaptive LED and with laser light, and the three do not interchange — different connectors, different control modules, different coding. The 2021 facelift changed the light signature on top of that.
Switches, ignition barrels and grille surrounds are simpler: they come from the shared X3/X4 parts bin and are common across the range. From the B-pillar back the relationship then ends completely — rear doors, rear quarters, roof and tailgate exist only as X4 parts. Headlights and switches are what we have available for it.