This fault happens because of a mechanical problem or a momentary loss of connection. You must contact your own bank's customer service immediately (not the bank that owns the machine, if it is a different one) to file a dispute claim.
The machine's cash is counted and its electronic journal is reviewed, and the amount is refunded to your account within 3 to 10 business days locally; the period may be longer if the machine belongs to another bank.