Hello,
1) It is not illegal to issue a medical certificate backdated of you had indeed consulted the doctor as you described.
2) It is possible that the concerned hospital may have policies that disallow complying with request after a stipulated period. However as you need it to be submitted for purpose of your employment or reimbursement the hospital ought to comply. You are not demanding the hospital anything illegal.
3) Do send a legal notice to the hospital concerned to issue the certificate.