The gun is not the cause here, it's the fact that children were left unsupervised at 10 PM.
I don't even have kids and I know you don't leave kids unsupervised, ever.
They wander into pools and drown.
They get run over by cars.
They burn themselves on hot surfaces.
They cut themselves with sharp objects.
All such tragedies are caused by the negligence of their caregivers, not by swimming pools, not by traffic, not by hot surfaces, not by knives, and not by guns.
The fact that it happened to be a handgun that the child injured the other child with is completely meaningless. Kids are going to do dumb things, dangerous things, when left alone.