So even if a court provided an order that allowed the marriage of persons who were not close in age, the court order would effectively allow something that would become a criminal offence.
I'll just leave it there, because I realize there's no answer to it.