Here is the code, you have two options: a) learn something you never knew b) remain ignorant, claiming how many millions of cabinets you have examined is irrelevant, your choice.
409.5.1 Located Within Same Room
The shutoff valve shall be located in the same room as the appliance . The shutoff valve shall be within 6 feet (1829 mm) of the appliance , and shall be installed upstream of the union, connector or quick disconnect device it serves. Such shutoff valves shall be provided with access. Appliance shutoff valves located in the firebox of a fireplace shall be installed in accordance with the appliance manufacturer’s instructions.
Piping Unions (CPC 315.1, 1212.5)
Unions (inline couplings) are only permitted downstream (after) appliance shut-off valves, meter locations, and immediately downstream on building shut-off valves. The use of right/left couplings and nipples are required in all other locations. Unions shall not be installed in a concealed location.
This is pretty much the norm for any places within the states that relies on codes. Maybe where you reside, it’s very very special, but I highly doubt it. It would help to know the OP’s location, but I’m certain they follow something similar or the gas company would not have flagged it.