All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The marriage contract is correct if some conditions are fulfilled, the most important of which are the consent of the guardian and the presence of two witnesses; for more benefit in this regard, please refer to Fatwa 82072.
So, if there is a proposal and acceptance between the two parties of the contract, who are the guardian and the husband, along with the presence of the witnesses, then the marriage contract is correct. It is not a condition for the marriage contract to take place in a particular place or to write official papers; the woman becomes the wife of the man, and announcing the marriage is desired and not an obligation.
However, if this marriage took place without authentication or announcement, it may lead to losing some rights in addition to what is mentioned in the question that the husband may be subjected to a punishment or brought to court, so it is more appropriate not to conclude this marriage. Nonetheless, since this marriage already took place, one should look for means in a way to avoid those disadvantages as much as possible.
Allaah Knows best.