1099-R help needed

In 2021 I was self employed and had no withholding.  I overcontributed to my SEP IRA (20,000).  I realized it and removed the excess allowable amount ($2,758) in early 2022.  I did not deduct this amount on my 2021 taxes, I only deducted the allowable ($17,232).  Box 7 on my form says 1 (early distribution).   

Do I owe the tax for an early withdrawl as part of my 2022 taxes?

Could I have deducted the full 20,000 from my 2021 taxes?

How do I fix this?