I’m not sure this ia quite right, but I will check out French law.
A situation similar to this existed in Ireland at one time in that Jehovah’s Witnesses and other non-mainstream religions had to have two ‘weddings.’ The reason was because bothe the the building in which the wedding was to be held and the person who performed the ceremony had to be registered. Kingdom Halls and ‘elders’ were not so they had to have a civil ceremony in addition to a religious one for it to be legal., although sometimes the registrar would come to the Kingdom Hall. This is not the case now as they are registered.
It may be the case in France that you have to register the marriage with the civil authority for it to be recognised in law. I would guess Catholics would see the religious marriage as the ‘real’ one. There are also problems on Europe at the moment concerning marriage and free movement of people, as some people who don’t know each other have got married to get, for example, a British passport. In such cases the registrar can alert the proper authorities., so it may be a form of immigration control.