How to compute backdoor Roth IRA capital gains?

I contacted Fidelity because I wanted to return the distribution of my traditional IRA back to my non-retirement account and they told me that I will pay taxes plus 10% penalty on the gains from the contributions that I have made from last month.  They suggested that why not do a backdoor contribution to my ROTH IRA and that way I will only pay taxes on the capital gains.  

My question is how do you compute the capital gains from the contributions that I made last month  if you do a backdoor ROTH?  I contributed $6k and they said it has a capital gain of more than $400 even though the cash was just sitting in my IRA account.  They said the IRS taxes me on the whole capital gains of my IRA account.