HSA deduction and 2019 overpayment

I had an HSA for all of 2019 supported by a Qualified High Deductible Health plan.  I retired in June of 2019.  My wife was on my employer coverage until July of 2019.  She started medicare when I retired.  I continued employer health plan under COBRA with the family coverage on the QHDHP for the entire year as I could not change it until open enrollment at the end of 2019.  Not knowing what changes would occur, I made sure my payroll deductions funding the HSA would reach the maximum allowed for us by the time I separated in June (8000.00).  Turbo Tax is telling me now, when I enter the coverage dates, that I over-funded the account and should withdraw 1750.00 from the HSA account by April.  Is this because my spouse was only on the family coverage for 6 months / started medicare in July?  Confused, and thinking we made a mistake by not leaving her on for the full year and delaying her medicare until 2020.

 

Thanks