The query is an example of a loaded question.
“When did you stop beating your wife” is a famous example of a loaded question, which is an example of a logical fallacy. Source
Viz: “A “loaded question”, like a loaded gun, is a dangerous thing. A loaded question is a question with a false or questionable presupposition, and it is “loaded” with that presumption. The question “Have you stopped beating your wife?” presupposes that you have beaten your wife prior to its asking, as well as that you have a wife. If you are unmarried, or have never beaten your wife, then the question is loaded.
Since this example is a yes/no question, there are only the following two direct answers:
“Yes, I have stopped beating my wife”, which entails “I was beating my wife.”
“No, I haven’t stopped beating my wife”, which entails “I am still beating my wife.”
Thus, either direct answer entails that you have beaten your wife, which is, therefore, a presupposition of the question.
So, a loaded question is one which you cannot answer directly without implying a falsehood or a statement that you deny. For this reason, the proper response to such a question is not to answer it directly, but to either refuse to answer or to reject the question.”