Well, I think the development was that Treppenwitz originally was just a Germanisation of l'esprit d'escalier. However Hertslet's book "Der Treppenwitz der Weltgeschichte" (The Treppenwitz of world history) mentioned on the Wikipedia page became a well known phrase and caused a shift in meaning, although the usage in the title of the book itself was still basically the original one.