Deductions & credits

As I understand you, you withdrew $2,000 in 2018 in order to pay for qualified medical expenses that you incurred in 2017 (or was it 2016?) but incurred in any case after you had begun your HSA. If so, there is nothing wrong with this, except that the expenses that you paid for with HSA funds cannot be claimed on Schedule A. 

If this is what you did, then you would have to amend your 2016 return (I guess that this is the return that you took an $866 deduction on) to reduce your Schedule A medical expense deduction.

However, you need to weigh the pros and cons: on the one hand, you will have to amend your 2016 return and pay some money (866 times your marginal tax rate)...but on the other hand, the HSA administrator is going to send you a check for $2,000 out of your HSA. On the whole, this looks like a winner for you.

Note that so long as a medical expense was incurred after the HSA was created (according to your state law), then you can take a distribution at any later time (even years later) to repay yourself for the after-tax expense.