Roth contribution in error

I calculated my taxes in turbotax in February 2022 for 2021 tax year and saw the MAGI allowed me to make Roth IRA contributions for both my wife and me.  So, we made those contributions.  Then, I received the 1098 from my investment company and there were large capital gains which put me over the maximum MAGI so that my Roth contributions were not allowed and turbotax now notes them as excess contributions and penalties.  I have not yet filed my 2021 tax return.  My investment company tells me that I have to fill out an excess contributions form and that it will be a taxable event.  But Roth contributions are not deductible so how can it be a taxable event?

 

Can't the investment company just reverse/negate the contributions since they were made in 2022 and I have not filed my tax return yet?

 

So, now what do I do in turbotax?  Enter the Roth contributions? or not? and how do I handle the excess contributions form which will likely show income?

 

Thanks.