Excess Roth IRA contribution

I contributed $7000 for my 2020 Roth IRA and learned in 2021 that my 2020 AGI was too high.  I withdrew the $7000 plus earnings and was under the impression I would not have to pay a penalty if I did so before the tax filing deadline.  Turbo Tax calculated that I owed the penalty.  Is this so?  Please advise and thank you.