Just because you are deregistered does not mean you have no VAT liability for the debtors at the time you deregister.
Of course you have to return VAT. According to the VAT acts, an invoice must be raised within 30 days of providing the service / goods.
I presume you are on a cash receipts basis, when you deregister you have to keep adjuecting the last VAT period to reflect the VAT on the cash receipts of the debtors at the end of that period. Basically, all the VAT on your debtors ledger at the time of deregistering will have to be returned. You must always account and pay VAT on deposits in the period in which the deposit is received.
If you have a bad debt, you raise a credit note referencing bad debt on it and issue it to your customer. It will reduce the VAT payable for you.