Fantine tells Mme Thénardier that she’s a widow. If Valjean could invent a new ID and go years undiscovered, could she have invented a dead husband and kept Cosette with her? How detailed were records in small-town France at the time? Sure, “Madeleine” arrives under special circumstances that distract officials from checking his ID, but would they have bothered to check the papers of a young mother and child? And if she was living openly as a widow, would the town busybodies have cared as much to dig up the truth? It’s her mooning over a secret, and her constant correspondence, that call her to their attention.
Maybe the factory wouldn’t have hired her. Maybe town officials would have seen through the story. Maybe the busybodies would have been just as motivated, or more, to dig up the truth, and she would have had to go through everything with Cosette traumatized alongside her.
There’s some similarity between Javert and the moral guardian who denounces Fantine in that they both think they’re doing the right thing to persecute her. But Javert comes across as less deluded, because even though he put the blame on the wrong person, at least there was a fight involved. Fantine wasn’t harming anyone by hiring a letter-writer on a regular basis.