You need to speak to your HSA custodian to see how they handled the refund internally. Technically, you had a "mistaken distribution" in that you caused the distribution of $39.20 for expenses that were going to be reimbursed by insurance. You may spend HSA dollars only on qualified medical expenses that are not going to be reimbursed by insurance.
Had the insurance company sent you the check, then you could have just completed the "mistaken distribution" form from your custodian (it's probably on their website) and sent the check properly signed over to them. This would have been the correct paperwork.
The problem with the way it's been done here is that you don't know if the HSA custodian knew that this was a "mistaken distribution" or was in fact a new contribution to your HSA which would generate a new tax advantage for you. I would assume that they didn't handle it properly, so you must check.
In the future, this is way you need to handle such events:
1. Pay the doctor at the time of service with your credit card or regular (not HSA) debit card.
2. When the refund check (or refund to your credit card or regular debit card) comes, you subtract this amount from the initial bill.
3. Contact your HSA custodian and ask for distribution to reimburse yourself for qualified medical expenses that were not paid by your insurance (in your case $49.00 less the $39.20). The custodian should send you a check or otherwise get the money to you.
The reason you have to do this is because this refund appears to be a contribution which ordinarily generates a tax advantage (deduction) that you are not entitled to - because you got the tax advantage the first time you contributed that money. Doing the process the way you did is "double-dipping". Furthermore, you probably don't know at the time of service how much of the bill the insurance will reimburse - hence you shouldn't take out anything from the HSA until you know how much the insurance will pay and how much you will pay from the HSA. No, this is not clear and your insurance company probably doesn't know that you have an HSA.
Yes, this process is a bit inconvenient, but unless you KNOW that the HSA custodian is treating the refund as a "mistaken distribution", do it the hard (and correct) way.
Note that you may ask the HSA custodian for a reimbursement of funds spent on qualified medical expenses at any time, so long as the original expense occurred after the HSA was created. Thus, it does not matter that the expense was incurred in December 2018 but you don't ask for the reimbursement until 2019. Also note that the reimbursement is not taxable income to you - it will appear on a 1099-SA as a regular distribution, and since you clearly spent it on qualified medical expenses, it will not be taxed.
Also note that the HSA custodian does not have to honor your request to process a mistaken distribution - this is why you avoid using this as a normal process.