1099-R Disability question

I qualified for SSDI in May of 2020.  I withdrew money in 2021 from my 401k.  I turned 59 1/2 in 2021.  I am on permanent disability and receiving Social Security.   My 1099-R Box 7 had a 1 in it for early distribution.  Can I use code 3 which is disability to save on the 10% tax penalty for this withdrawal?  This is quite confusing on what determines total disability, but I had a hearing to qualify for SSDI and Judge found me permanently disabled and qualified for SSDI benefits.