It might also be strong evidence (enough to convict standing alone) in a timely obstruction of justice prosecution. This statute of limitations wouldcould also run from the date of the sworn statement, or from the date of a false unsworn statement that caused a conviction to be reopened.
It would violate the ethical rules of many professions. For example, an attorney would probably be disbarred for doing that. Arguably, in this situation, the statute of limitations could run from the later unsworn statement date rather than the date of the sworn statement.
Harder Cases
The hard cases aren't the cases where "the actual truth cannot be found out". Instead, the hard cases are the cases where there is strong evidence that the statement made in court, under oath was true.
For example, suppose Ted Cruz is asked in court: "Were you the Zodiac killer?" (A crime ridiculously attributed to him despite the fact that it is something that happened when he was a small child who live many hundreds of miles away.) And he says, "No" in court, but then leaves the courtroom and says in a press conference on the court house steps: "I am the Zodiac killer, I lied about that under oath in court today."
Similarly, suppose that a DNA test on a certain blue dress shows a perfect match to President Bill Clinton and Bill Clinton says under oath in court, that the substance tested came from him on a certain day, in a certain place, when a certain person was wearing it, in a certain way (also confirmed by a witness and surveillance video). Then, he leaves the courtroom and says in a press conference on the court house steps: "Someone else was the source of that genetic material. I never met that person, and I was in Kenya on the day alleged and I've never set foot in the White House. I lied about all of this under oath in court today."
In these cases, there is no plausible way to make an obstruction of justice or perjury charge stick, or to upset a verdict or judgment consistent with the truthful sworn statement.
Contempt of court is still possible, as would professional ethics violations, but other consequences would be less obvious, because the act would come across more as absurd instead of something that genuinely confounds the truth.
The legal consequences associated with the conduct in the original post are mostly aimed at sanctioning genuinely fraudulent conduct. Our legal system is more confused about how to respond to lies so blatant that they only amount to feeble and ineffectual gaslighting that no reasonable person familiar with the circumstances would believe (but that might incite crazy conspiracy theory thinking supporters). The harder case would lie in the uncanny valley between a bad joke and a pathetically weak attempt to mislead people, even though the law is clear about how to deal with clear sarcasm and convincing attempts to lie that can't be clearly proven or disproven with other evidence.