401k return of excess distribution

Brief summary: I am 55 years old. I switched jobs and I rolled over my old employer 401k  to my IRA with a check in the amount of $86000 in June 2020.

The amount I received was in error because old employer did not factor in that I was not fully vested. The amount I should have received was $47000

The rollover was $39,000    more than I was entitled to. 

I was instructed to have my IRAreturn the overage amount to them. I contacted the The IRA company in October and they told me that they could only send me the check  and the amount had to include current value of the $39000. Therefore, Fidelity sent me  a check for $44,000 , which was $5000 above the requested amount.  I never kept this money. I wrote a check to the old company 401k for the exact same amount, 44000. 

My 1099-R from old company  was for $86000 nothing taxable. 

My 1099-R from my IRA has distribution of $44,000.  Box 2a has value of $5000. which  is taxable to me. I never kept the money and it was sent back to the old 401k. 

Based on TurboTax, I have to pay $1700 in taxes and 10% penalties.  

Do I have to pay this tax?

How do I configure my tax return so I do not have to taxes on money that I do not have? (returned to old company 401k)