In the event of a breach of the formalities prescribed by law on pain of nullity or failure to observe essential formalities, the liberty and custody judge hearing an application on this ground or who notes such an irregularity of his own motion may only order the release of the person being held in the waiting area where this irregularity has had the effect of infringing the rights of the foreign national.