The source relates an exchange involving al-Ḥajjāj in which a person is expected to respond in a direct and surface-level manner, but the speech is redirected toward a more pointed meaning.
The rhetorical issue is not wit for its own sake. The expected literal course of the conversation is replaced by a different meaningful relation, thereby producing surprise and directing attention.
When analyzing an unexpected answer, identify the anticipated response, the form actually given, and why that response remains relevant to the dialogue. Mere surprise without a meaningful relation is not the intended benefit.