Get your taxes done using TurboTax

when earnings gain or (loss) changes the amount you get back

that does not change the amount of excess you removed.

 

if the earnings were positive you have to report that as income for the year that contribution was made, and possibly an early withdrawal from a Roth.

 

@fluxquantum94