While this behavior maybe isn't optimal, it's not completely unexpected.
Because the lines with stanza names didn't have the opening square bracket, they weren't correctly recognized as the beginning of a new stanza, and since there aren't any transforms.conf settings with that name, those lines were simply ignored. This caused all the filename lines to be added to the previous stanza. I assume in your transforms.conf there weren't any previous stanzas, so the filename parameters were outside of any stanzas, which made them part of the default stanza. And since the default stanza now had multiple filename parameters, Splunk just used the last one.
So in the end, using the inputlookup command with any unconfigured lookup names, returned the default lookup. In fact you could have used any random string of characters as the lookup name, and it would still return the contents of ABC.csv.
... View more