Hi, welcome to the forum, yes, it can be secondary to the sleeping pills. As the sleeping pills predominantly acts by GABA neurons which has inhibition effect. This may be responsible for loss of bladder control. For now, it would not be matter of concern.
If it repeats, then you need to rule out the type of incontinence i.e. Urge incontinence, Stress incontinence or mixed incontinence. The causes are Urinary tract infection (symptomatic with frequency, urgency, dysuria, etc), Stool impaction or may be Psychological. The therapy includes Bladder training, Pelvic muscle exercises, Electrical stimulation devices and anti-cholinergic can help to alleviate the condition. If it repeats then I suggest you to consult urologist for further management. Take care and regards.
It is very unlikely, but possible. Some people experience random bedwetting during their REM sleep (the deepest dreaming levels) if they dream about going to the bathroom. This is rare, and you'd have to be a very heavy sleeper, but it is still best not to take more than the recommended amount of a sleep aid. Your body will signal to wake you if you have a full bladder that needs releasing.