Jean-Yves Le Drian, the defense minister, acknowledged on France Info radio on Wednesday that the software that customs officials use to check for blacklisted passports was not working at the airport in Marseille. But he laid blame for the episode on Turkey, which, the Defense Ministry said, had notified the French authorities of the change of airports only after the three men had landed in France.

The Turkish Ministry of Foreign Affairs declined to comment on Wednesday, saying that it was still investigating.

Mr. Etelin, who was Mr. Baghdadi’s lawyer until Wednesday, said the security failure was all the more remarkable since the three suspects had offered to turn themselves in to the French authorities. He said by telephone that the three men were astonished when they arrived in Marseille to find no officers waiting for them.

He said they rented a car, drove toward Toulouse and tried to turn themselves in at a village police station, but the police were away on rounds. “Everything in this story is absurd,” Mr. Etelin said. They eventually surrendered to the police in Le Caylar, a village northwest of Montpellier.

Mr. Etelin said the men left for Syria this year to join the Islamic State, also known as ISIS, but were shocked by its brutality and decided to flee Syria for Turkey in July. They were captured by ISIS and jailed on suspicion of being French spies, he said, but later escaped, walking about 19 miles to the Turkish border, where they turned themselves over to border guards. It was not possible to verify Mr. Etelin’s account.

“Like many who go to fight in Syria for jihad, they had fantasies of a Shariah state,” he said. “But they saw horrible things that repulsed them.”

At a time of heightened alarm about terrorism in France, the episode has generated both embarrassment and soul-searching, and prompted calls for better coordination with Turkey.

The events “have humiliated us and made us a laughingstock in front of the entire world, and this government is a government of incompetents,” Christian Estrosi, the mayor of Nice and a member of the National Assembly in the opposition Union for a Popular Movement party, told LCI television. “How can it be that we send planes to Iraq and do not properly control our borders?”