Examine the item and compare it with the definition in Regulation CC section 229.2(fff) of a "remotely created check." If it meets that definition, the check comes with transfer and presentment warranties under section 229.34(d) that protect you as the paying bank.
If you received the check via the Federal Reserve, there is an adjustment return entry your bank can make to return the check well after the midnight deadline. But first, you need to get from your customer an affidavit that the customer (1) did not authorize the issuance of the item (2) payable to the person named as payee on the check (3) in the amount stated on the check. All three of those facts need to be stated. Then you can follow the instructions provided by Federal Reserve Check Services for completing the claim.
If you don't meet the criteria for the Fed's claim service (if too much time has passed, for example), you have a claim against the depositary bank directly, which you can pursue in correspondence with that bank (without entry claim) or in court if necessary for up to one year. The depositary bank in such circumstances may attempt to raise a defense that your customer's claim that the check wasn't authorized was made too late to compel your bank to reimburse your customer (based on the UCC in your state or a notice requirement in your bank's deposit agreement).