This isn't an answer to your question, but I'd be wary of making the assumption you did. Cosette isn't really "bought" by Jean Valjean.
The actual situation is that:
Valjean has a letter signed by Cosette's mother Fantine, requiring the Thenardiers to release Cosette to him so he can take Cosette back to her mother.
However, the Thenardiers are greedy and realize that Valjean is desperate to have Cosette and also that he has money. So they tell stories about how much money they've spent on Cosette, knowing that Valjean will just pay them rather than argue.
Valjean has the legal right to take Cosette, but his case is weak because by this time Fantine is already dead, and Valjean is on the run from the police. So he's willing to pay rather than get confrontational.
So Cosette isn't really "sold", ostensibly, she's given to the care of Valjean so he can take her home to her mother. The money is tangential to that, it's basically Valjean (as Fantine's agent) settling accounts with the Thenardiers, who were paid to look after Cosette.
That said, there is plenty of evidence of parents selling their children in desperate times, such as during famines. This not only happened in the 19th century, it happens in parts of the world even today.