the people who got the private stuff would still get in legal trouble. even if they didn't know he was underage, they were still in possession of child pornography. if they were able to prove he lied about his age to them, then maybe they could get less of a harsh sentence. but they'd still be in trouble for possession. and if it was just a message of him saying he's legal, that could not be enough, probably depending on the judge/jury. i can totally see a judge or the opposition's lawyer saying "well, if the age was questionable, why wasn't a form of id requested?".
the laws with that are very harsh, and they'll fuck over anyone. a minor sending nudes to another minor is breaking the law for producing and distributing cp, and the minor receiving them is breaking the law for having them