But even with that in mind, the idea of blowing up a 3L bottle is that you as that pyromaniac teenager probably at least ensured no one else was nearby.
That's a difficult guarantee to make in a school setting, and it's important to realize that it's a separate issue. Blowing things up might even be OK at school, in a controlled setting, people kept a safe distance away, and some idea of what to expect from the reaction. It's all fun and games until it's lye in your friend's eyes.
I have no clue at all whether the student took these precautions as the original article just says it happened on school grounds. That could mean a bathroom or in the middle of an empty field, I have no way to tell, so I won't try to talk to specifics on that.
But in general "I had nowhere else to do activities plausibly harmful to the safety of those around me" is not justification for performing activities plausibly harmful to those around you. So the question to whether she has a backyard or even a home is completely irrelevant.
gavinlynch's premise is (literally) "Right. But you didn't do it during school." (see https://news.ycombinator.com/item?id=5651679 )
So which is it? Is the problem that she did something "dangerous" (meaning many of the posters here should have been punished, even if lightly so)? Or is she a special case because she did it at school?
And what if she didn't have anywhere else to do it? Do we know if she actually has a backyard or a playground/park to conduct this experiment? Do we know if she has a home? (I suspect she does, but I haven't seen it stated conclusively).