I got left in the car as a kid all the time when my dad went into the supermarket because I’d be a right royal pain in the arse if I came in.
If it’s cool enough and the kid’s safe and not scared then no biggie.
I don’t doubt for one moment the race definitely plays a part in who gets charged and who doesn’t.
At the end of my in laws small 8mx8m garden is a freight train line, and honestly, you just don’t hear it anymore once you’re used to it.