Really interesting concept you brought up, did not know that law and yes it makes perfect sense.
And I totally get your point, but it is still an issue to me considering that she wanted to keep the audience hooked as they aged. As someone put it in another comment, in the first book, Harry is eleven, it appeals to kids ~11 y.o, and so on. But, and I speak personnaly, by the fifth book it was already too disjointed for 15 y.o. me. Her books are like a Jojo’s Bizarre Adventure book/episode, but without all the corny humor and the self-awarness that makes it fun.
Idk, my oldest kid is 10 and has finished the whole series. She may have intended kids to grow with the series, and that was certainly true when they came out (I remember my cousin reading the books as they came out), but I do think they have limited appeal to more mature audiences.
That said, I do still read YA novels, and I’m definitely not the audience, so I’m sure there are plenty of older kids and adults who aren’t as bothered by plot holes and whatnot.