Retirement tax questions

You don't, that's just bad luck.  Nothing that happens inside the 401(k) has any tax consequences until you withdraw the money.  Gains and losses don't count.  If you lost money, you will have less to withdraw when you retire so you will pay less income tax at that time. 

 

Let's go over the rules.

Suppose you contributed $25,000 when your limit was $19,500; that's a $5500 excess.  The first thing that happens is you pay income tax on that excess -- it's added back to your taxable wages.  That's fixed in law, no matter how much the account was actually worth.

 

Then, you have a choice. Since you have to pay tax on the money and don't get the benefit of a tax-free contribution, you might want to take the money out and do something else with it.  Or, you can leave the money in the account, there's no penalty for doing that.  It's just that if you leave the money in the account, it gets taxed twice.  Once now, and again when you withdraw it.  But you pay tax on whatever you withdraw, ignoring any gains or losses on the way.