Pub 590-A says 2022
You will need to embody in your gross earnings the curiosity or different earnings that was earned on the surplus contribution. Report it in your return for the 12 months wherein the surplus contribution was made. Your withdrawal of curiosity or different earnings could also be topic to a further 10% tax on early distributions mentioned in Pub. 590-B.
Your extra contribution is related to 2022 (whether or not you really exceeded your 2022 restrict by contributing in 2022 or 2023 for 2022).