One of the problems that I can see with the ANSI code system for American HID lamps is that it leads us here to think that any lamp used on a mismatched ANSI code ballast will ALWAYS burn out instantly even though a certain pair of lamp types has similar voltage and current such as 150w M102 metal halide and 150w S56 high pressure sodium. I saw this type of thinking when I saw one member who had a 150w M102 pulse start metal halide wall pack and thought that 150w S56 high pressure sodium lamps will damage it.
Well, very often a different ballast load curve shape even with equal nominal voltage and current does mean performance degradation.
The matching ANSI code just mean not only the basic rated voltages or currents match, but as well the load shape, current crest factor, eventually extra protection features (because e.g. MH can rectify very significantly at EOL and xo damage the ballast, even causing fire, so require the ballast to be equipped by a thermal cutout), or e.g. ignitor delay timers (inhibiting pulsing for some time when the lamp does not ignite within few seconds of pulsing, and restart the ignition pulses after few minutes, so the lamp has cooled off; so the lamp isn't worn off by cold electrode sparking when cooling down during hot restarting; these timers needs to match the lamp thermal inertia if to be effective).
Not speaking about higher efficacy lower power lamp variants, designed to replace the higher wattage original (so a lamp may be just 320W rated, but designed to operate on a 400W ballast; so even when the rated power wont match, the ANSI code will and so guarantees the compatibility).
Yes, sometimes some lamp may be able to operate on other ballast, but it is not guaranteed it will really perform as intended.