OK, I erred in my previous post, and I've now corrected that post.
See Canon Law:
Can. 1108 §1. Only those marriages are valid which are contracted before the local ordinary, pastor, or a priest or deacon delegated by either of them, who assist, and before two witnesses according to the rules expressed in the following canons and without prejudice to the exceptions mentioned in cann. ⇒ 144, ⇒ 1112, §1, ⇒ 1116, and ⇒ 1127, §§1-2.
So 2 witnesses are necessary for validity. If there are not witnesses at all, it is not a valid marriage.
However, suppose the priest turns out not to be a real priest. Canon 144 states this exception.
Can. 144 §1. In factual or legal common error and in positive and probable doubt of law or of fact, the Church supplies executive power of governance for both the external and internal forum.
So this would imply that a factual error, mistakenly thinking that the presider is a priest when he is not, would not invalidate the marriage. For the Canon that requires a priest to "assist" (preside) at a wedding specifically says "without prejudice to the exceptions mentioned" in Canon 144.
A priest is not strictly necessary for a valid Sacrament of marriage because a deacon and even (in extraordinary cases) lay person may preside at a wedding ceremony. See canon 1112.
Roman Catholic theologian