Roth 401k rollover to Roth IRA and excess contributions

In 2019 I contributed to a Roth 401k through a prior employer.  I left the employer in December 2019 for a new opportunity. In January 2020 I rolled over the money from the Roth 401k account into an existing Roth IRA account (direct rollover, trustee-to-trustee).

 

When I received my 1099-R forms for the 2020 Roth 401k to Roth IRA rollover - I received two separate forms one with a code 8 in box 7 and one with a code H in box 7.

 

8 - Return of contribution taxable in 2020

H - Direct rollover of a designated Roth

 

I have followed up with my former employer and they have informed me that their 401k plan in failed their plans non-discrimination testing in February 2020 (after I had already rolled over my 401k) as part of their 2019 plan year end testing. For the plan to remain qualified / compliant they needed to return some of the employee contributions.

 

Since my Roth 401k contributions had already been rolled over to my Roth IRA - there were no funds to return to me.  I was never notified of the plan testing error or that some of my contributions had been reclassified as excess contributions.  When I received my 1099-R a portion of the funds had been classified with code 8 to indicate that the funds were not eligible to be rolled over.

 

I have done some research but am still trying to understand the proper tax handling in this situation and the right way to resolve this situation.

 

Can anyone help clarify the right way to handle this situation?

 

1. From what I have read it sounds like I need to work with my former 401k provider to understand what portion of the amount that was supposed to have been returned to me was from a Roth 401k contribution and what portion was earnings on top of the Roth 401k contribution.   

 

2. From what I understand if my Roth 401k contributions were classified as excess contributions due to a plan non-discrimination test failure - those after tax  Roth 401k contributions should be returned to me and should not be taxable.  From what I understand the portion that is returned that is earnings on that Roth 401k contribution would be taxable (and possibly would have a penalty charged on top of that as well)

 
3. From what I understand if I provide my current Roth IRA provider information regarding the amount of my Roth contribution and the amount that was earnings on the Roth contribution that was classified as an excess contribution - they should be able to distribute those funds to me.

 

I want to make sure that I'm not being taxed twice (unnecessarily) on the original after tax IRA contributions -and I want to make sure I'm not being taxed twice by the IRS - once for these 2020 1099-R documents that indicate that I had excess contributions from my old 401k and then a second time in 2021 when I receive the excess contributions from my current IRA provider.

 

Thank you in advance for any insight or advice that you can provide.