Excess Roth Contributions in 2023

I have a few questions for a CPA/tax expert.  For the first time ever, we had excess contributions in my husband's Roth IRA in 2023 due to our MAGI being too high.  On April 9, 2024, the IRA custodian processed the return of the excess contribution requested and earnings.  The earnings resulted in our MAGI increasing slightly, so we still have an excess contribution, which results in a 6% excise tax.  My husband will be 59 1/2 before year-end 2024.   

 

If we leave the excess contribution in my husband's Roth IRA in anticipation of applying it to 2024 contributions, what happens if we cannot use the remaining 2023 excess contributions as 2024 contributions due to our MAGI in 2024 being too high? 

 

It is difficult to know how much of the excess to request as a return since it is hard to know what the related earnings will be as calculated by the IRA custodian until after the request is processed.  Does the tax code allow us to request a return of the remaining 2023 Roth contributions of $6,520 and related earnings to totally clear up this issue?  Or, are we only allowed to request a return of the actual excess contributions that would get us within the limits?  

 

Any insight is appreciated.