I assume your strategy is to bury the "real" question in a set of distractors. Apart from the incentive that all good people want the truth to come out and justice to be served, there is a penalty for lying under oath: this is the crime of perjury, which can result in a prison sentence. The strategy of testing a witness would not work (would not be allowed). "Test questions" are not allowed, and any questions have to be relevant to the matter. Opposing counsel would object and the questions would be stricken. An attorney is not allowed to threaten a witness (the test relies on a threat). Finally, perjury is not the same as getting the wrong answer, so the attorney "knowing the answer" is irrelevant. Perjury is when a person knowingly makes a literally false statement. To be jailed, it would have to be shown that the witness knew that their testimony was false.