Retirement tax questions

Incorrect.  since your 2023 excessive Roth IRA withdrawal Will be reported in 2024 and will be on your 1099-r you receive in 2025 as a 2024 1099-r  with codes J and P , you do not use code 8.   A code 8 would be used if you withdrew the 2023 excessive Roth IRA in 2023.  Since the excessive 2023 Roth IRA WAS withdrawn in 2024. It will have P and J.