In the Brā́hmaṇa period there are many such fossilizations of abstract words, which seem to be purposeful (given the purpose of Brā́hmaṇa texts as metaphysical commentaries on ritual specifically) rather than a large class of words whose meanings were entirely forgotten. Thus we also have words like krátu “will” that becomes “sacrifice”, or puró-hita “first-placed” that becomes “priest”, or puro-ḍā́ş “first offering” that becomes “rice-cake”, or tiró-ahnyam “throughout the day” that becomes “day-old offering” (according to Thomson).
Rather, these Brā́hmaṇa meanings (usually originating within the Mántra layer itself) are mystical formulations or plays on words, and should be taken as such rather than assuming that the Brā́hmaṇa priests were unaware of the facts around those words. We see a similar phænomenon with the “Brā́hmaṇa-style etymologies”, many of which are clearly not meant to be serious etymologies.
In “कस्मै देवाय हविषा विधेम”, some people (including at least Aitareya Brāhmaṇa in a different context) read कस्मै not as dative case of the pronoun कः but as the dative case of the name of a god named कः. But won’t the dative case of कः as a noun be काय?
These sorts of mystical “punning” formulations præsent throughout the Brā́hmaṇa-s (trí-ambaka < stríyā Ámbikā ŞB 2.6.2.9, sóma < svā́ me ŞB 3.9.4.22) often aren’t meant to be taken seriously as actual linguistic analysis, but rather a sacred identification or association.