I received a Form 1099-R from my brokerage with box 7 (Distribution code) marked with Code J indicating that I will be paying a 10% penalty for withdrawing the money. From my understanding, I'm able to withdraw my contributions whenever I want regardless of the age of my account, with the penalty only applying to money that is earned within the account. I asked the question on this forum previously, and the article linked below seems to suggest that. Given this information, am I doing something incorrectly when filing taxes that's causing the software to apply the penalty? If it is relevant, I contributed in both 2022 and 2021. I withdrew the money from the 2021 contribution year before I contributed any for the year of 2022. Is this what could be causing the penalty to be applied? On form 8606, I input the Basis in Roth IRA contributions as the sum of the amount I had contributed for the years of 2021 and 2022 subtracted by the amount I withdrew.
I think you're misunderstanding Code J. It doesn't mean "this withdrawal is definitely subject to a 10% penalty", it means "neither of the two exceptions to the penalty apply" (Q - 5-year holding period, T - age/death/disability). It means you the filer must fill out form 8606 to figure the taxable portion, if any. As long as you've only withdrawn your contributions (distribution <= basis) none of it will actually be taxable.