Capital gains and dividends distribution from IRA to non resident alien

Hi,

 

I was working in USA till Sep 2018 and had 401K from my employer. I left USA in Oct 2018 and did not return till now. I rolled over my 401K to IRA in Jan 2019 and in Dec 2020, I asked my IRA custodian to cash out the capital gains and dividends earned in 2020 on my IRA amount instead of reinvesting them. I need to pay taxes on these capital gains/dividends and I believe i will also have to pay 10% additional penalty. I am a non resident alien for 2020 as I was not in USA in 2020. My question is about the tax treatment of these capital gains/dividends that are cashed out to me. Will these be treated as Effectively Connected Income and taxes based on the normal tax slabs or these will be treated as FDAP income and be taxed at the rate of 30% as I am a non resident alien for 2020? Thanks for your time and help.