How to file tax with form 1099-R of distribution code P in box 7 ?

Hi all,

I over contributed $5000 to my 401k account in year 2022 (due to multiple employers), I withdraw them on 04/02/2023 before the tax filing deadline, I received a check of $4750 with a loss of $250 (stock investment), from Fidelity.

 

I filed my tax in Turbotax by reporting $5000 as "other earned income" (probably I had to fill in this amount), afterward, I received the form 1099-SA with code P in box 7, and amount $4750 in box 1.

 

What should I do with this form in Turbotax, how can I claim the loss ?