This is a situation which rarely occurs. It happens usually if there was any network communication error during the code generating and sending process. However, if this does happen, the best solution for a guest is to get in touch with the front desk associate and notify the issue.
A front desk receptionist should then delete the booking and re-create the booking again. This will re-generate a unique code and send it to the respective email or phone number associated with the guest. Make sure the guest has cellular network reception to receive a text or internet access to able to receive the email.