That is not the question. The question is "Can immoral laws compel obedience?
The "Following Orders" excuse led to some very horrible results. I eschew a philosophy underpinned by that principle.
No. You don't have to obey immoral orders. In fact, you have a duty to fight them.
“The question is “Can immoral laws compel obedience?”
No one requires her to perform the marriage. All she is being asked to do is certify the people applying meet the requirements set by the law.
She is not being asked, “Do you approve of this marriage?” She is being asked, “Have these applicants complied with the law?”
If she was being required to participate in the marriage, or to perform it, or to approve of it as moral in the eyes of God, I’d support her. But all she is being asked to do is see if X & X have complied with the law.