Deductions & credits

It was my husband's HSA.  He went on Medicare April 2022 and we started the HSA deductions from his check in February 2023, not knowing wasn't allowed.  I started Medicare Fall of 2024 and learned this and we stopped his deductions at work immediately.  So, if I go ahead and use the bal in HSA now, to take down to $0, then when amend 2023, I say on Turbo Tax the amount that was contributed and incorrect, and it will list it as income to be taxed and a penalize the amount at 6% for 2023.  Additional penalty for 2024?