The problem is that any age verification system effectively becomes an identity verification system. And such tools rarely remain "just for kids"—they quickly become used for other purposes. The only secure way is to verify not the person's identity, but the device's status (for example, that it's a children's device). This is called age assurance: we confirm age without knowing who exactly is in front of us.
Then it's up to parents to give their kids child-locked devices and for stores to not sell unlocked devices to kids.
Also all of these companies know from advertising data, and location data, that you are at school, who you are, etc. They would also know that all of your friends are also teenagers.
If the law is serious there are many many ways to enforce this without violating privacy.
How do you prevent kids uploading photos of themselves?