The D/D can be returned unpaid and has no call on your account balance until the date it is presented whereas your ATM withdrawal is instantly recognised as a cash withdrawal and allowed for when the Bank calculates your daily cleared balance, d/d's are debited on dates the Banks are all open never weekend dates.
Always leave a surplus in your account to meet any d/d's set up on your account, the mandate you signed allows the date it is presented to vary, on this occasion the account holder left themselves with inadequate cash to meet the incoming d/d as they took the available cash out, can't have it everyway when you have d/d's I'm afraid.