French lawmakers have voted for a flagship article in a new law which will give citizens the "right to make mistakes" in dealings with the government without being automatically punished.