Retirement tax questions

There is a big difference between investing within the HSA and withdrawing the money from the HSA to invest it some place else.  If this is a withdrawal, you will get a form 1099-SSA.  If not used for qualified medical expenses, it is subject to income tax plus a 20% penalty.  You can avoid the penalty if the HSA bank will allow you to do a "return of mistaken distribution" but you must do this no later than April 15, 2024.  Since the money is locked up in a CD, you will have to find money from some other source to make the return, or pay the penalties.