Recovering from wrong amount in attempted Timely Withdrawal of Excess Roth Contribution

I made excess Roth contributions for 2021 and 2022 (early in the next calendar year, $7000 each year), and discovered this in 2023 before filing for 2022.

 

Before the filing deadline (as extended for California), I withdrew enough to cover both the 2022 contribution +/- the gain/loss and the 2021 principal contribution, and filed a 2021 1040X reporting that year's excess contribution. However, due to my naivete and hastiness at the time, the withdrawal came out in multiple chunks, the first of which was $7000 -- not quite enough to cover the contribution for 2022 plus the few day's gain.


I have since generated a spreadsheet that subdivides the 2022 contribution +/- gain/loss across the first two withdrawals.  Its contents are complicated enough to make me wary of trying to communicate it to either the IRS (in the required explanatory note), or to my broker (to request a proper 1099R).  I did not contact my broker to request a non-standard Roth 1099R for 2023, so I have received one that reports a simple total of the withdrawals under code Q (I am over 59 1/2).

 

Generating a replacement 1099R is described by @DanaB27, although I remain unsure which of the codes is appropriate for each of the 2021 and 2022 repayment portions.

 

The IRS will of course receive a copy of the original 1099R from my broker, so any difference between the two is a complication.

 

A possibly lower-risk strategy would be to abandon my claim of timely withdrawal for 2022 and simply file a 1040X for that year as well, reporting another $7000 excess contribution.  That way, the 1099R could report the same code letter for both, with a simple sum of $14000.

 

Would a broker-generated 1099R reporting the proper code be less likely than a self-generated replacement to cause trouble with the IRS, for my 2023 1040 filing?

 

Whether broker- or self-generated, what should be the 1099 code(s)?