It's wrong to leave while babysitting.
John is babysitting for friends when he realizes that they are out of diapers and the baby needs changing.
John needs a diaper to change the baby.
John fashions an emergency diaper out of an old towel.
John runs out to the store to but diapers, leaving the baby alone.
John is able to stay with the baby and keep it safe.
The baby is left unattended and could potentially come to harm.