Retirement tax questions

The "code" I'm referring to is that of the transaction where I put some money back into the IRA, not the 1099-R code in box 7.  As I understand it, currently the money returned is marked as a contribution to the IRA, which I'm not eligible to make since I had no earned income in 2022.  The mistake I'm referring to is not the box 7 code but that, in my thinking, the total withdrawal amount shown in box 1 Gross Distribution or 2a Taxable amount should be less considering I put some back.