Consider that according to the Catechism of the Catholic Church,
“To lie is to speak or act against the truth in order to lead into error someone who has the right to know the truth” (2483).
A classic thought experiment is that of a person concealing a Jew during the Holocaust. If the Gestapo knock on the door and ask if there are any Jews in the home, do they have the right to know the truth? Of course not. In this case Catholic teaching recognizes that merely making a statement that is contrary to fact is not necessarily even a lie. It might be the morally upright course of action.