I read an interesting piece of research a few years ago. People were given the following scenario: A mother with a child strapped in their car seat, parks in a multi-storey carpark and gets out. Before she opens the back door to get the child out, she collapses and is out cold beside the car for an hour. What level of risk is the child exposed to?
Respondents tended to think the child was in a relatively low risk situation - strapped into a car, under cover, unlikely that anyone with bad intent would happen upon them.
The same scenario is given but this time, the mother doesn't collapse by the car, she goes off to get her nails done for an hour. In this scenario the level of risk to the child was judged to be much higher.
The point of this is to show you that our perceptions of how dangerous situations really are for children are based very largely on our judgement of the parent.
Your kid was not at risk. You did nothing unreasonable. You could do it again, and no harm would befall your child. It was fine. Stop judging yourself so harshly. You're not a bad parent.
Incidentally, when the parent in the scenario was a Dad, either collapsing or going for a jog, the child was judged as being at even lower risk. Go figure.