dmertz
Level 15

Deductions & credits

The only phrase I've seen is a "return of a mistaken contribution" as you've already mentioned, which I've seen on several HSA custodian's forms.  The only authoritative reference I have is IRS Notice 2008-59.  Q&A-23 seems to be targeted at employers and states, "If the employee was never an eligible individual under § 223(c), then no HSA ever existed and the employer may correct the error."  Given the first part of that sentence, there's no reason to believe that an HSA exists no matter how the account was opened, based on IRS Notice 2004-2 Q&A-2 stating that those eligible to establish an HSA are those who are "eligible individuals" as defined in Q&A-2.  If no HSA exists because the individual was not an HSA-eligible individual, the money deposited can't be an excess contribution to an HSA and can't be subject to additional taxes.

It might just be that you have to take it up with the IRS as I indicated above.  If the IRS disagrees with my analysis, you'll end up owing the penalties and tax that I mentioned.  Regardless, you'll likely want to get the money out of the HSA before the end of 2018 to put an end to this situation.

One other possibility is that you could treat the HSA as actually existing and containing an excess contribution, then just spend all of the money on qualified medical expenses.  In the year that the balance in the account is reduced to zero the penalties will stop since the excess-contribution penalty for a given year is 6% of the lesser of the excess or the year-end balance.  The problem I see with this is that it's not clear that the excess contribution actually goes away, rather, only the penalty goes away as long as you never have an HSA balance at year end.