In any case, I don't think a technical countermeasure that addresses a subset of cases erases the concern. You're presupposing harassment happens by SMS, which maybe was true 10 years ago.
How would your solution work with students' frequent use of Discord?
Schoolchildren would have to stop using any service that doesn't have a block-anonymous setting, or, accept that the school will ignore any complaints about anonymous messages. I think the biggest problem with the whole thing is that the kids won't stop using the services they want to use.
Apple could theoretically make a system setting to block unidentifiable messages (not phone calls) specifically to protect kids, in all apps on that phone.
When you speak of erasing the concern, do you mean the concern about bullying or the concern about going into children's phones and looking at text messages?
Schools already heavily discourage Discord use, but most students use it. Most students aren't bullied, either, so the bullied students complying only further isolates them. It's pretty intrinsically anonymous, too. Accounts need to have a phone number on record, so in theory one could subpoena it... but it's not like a correct phone number is needed for everyday interaction.
Also, sometimes the bullied student isn't even in the message chain. Taking pictures of students at school, then manipulating them and circulating them online and getting everyone else at school to laugh at the victim student when they return is a common tactic.
Then you have Student ABC complaining. Students have been counseled to stop but it keeps happening. ABC believes student DEF did it, and some corroboration that it is student DEF such that the school is now 90% sure that student DEF is behind this. Student ABC is the subject of increasing ridicule and is now doing poorly at school. What's the next step?
Yes, your scenario is one I hadn't considered. I don't know what a good resolution is there; I would suggest that DEF is not necessarily the bad guy. Maybe. But not necessarily. This one is also difficult to punt to the police since there's no clear harassment, yet ABC's torment is increasing. It's sad but I think it's often better for the child to solve the problem himself.
In today's "zero-tolerance" world, that usually leads to the victim getting in at least as much trouble as the bully does.