The way this should work is this:
1. TurboTax detected an excess HSA contribution amount on your 2017 return, in early 2018.
2. This amount was added back automatically to your Other Income (line 21 on form 1040).
3. You called the HSA custodian in early 2018 to request the withdrawal of excess contributions.
4. The HSA custodian sent you a check.
5. You filed your 2017 return.
6. In early 2019, the custodian send you a 1099-SA with a distribution code of '2'. The amount of earnings on the excess is in box 2.
7. When you are doing your 2018 taxes, the earnings are added to Other Income as they should be.
8. Any amount in box 1 if the distribution code is '2' is ignored (as it should be).
Now, in what way did your experience differ from this?