One big part of this is that gcode isnt really a 3d model its a set of instructions on how to move the printhead around. You don't download the gcode directly, because that varies by printer. You download a model, and then a slicing program turns that into a set of printer-specific gcode. Any subtle settings changes would change the hash of this gcode.
And the printer doesn't really know what the model is. It would have to reverse the gcode instructions back into a model somehow. The printer isn't really the place to detect and prevent this sort of thing imo. Especially with how cheap some 3d printers are getting, they often don't really have much compute power in them. They just move things around as instructed by the g-code. If the g-code is malformed it can even break the printer in some instances, or at least really screw up your print.
There are even scripts that modify the gcode to do weird things the printer really isn't designed for, like print something and then have the printer move in such a way to crash into and push the printed object off the plate, and then start over and print another print. The printer will just follow these instructions blindly.