You qualify if you withdraw the excess distribution before the due date of your return (including extensions).
For example, if you accidentally contributed $1,000 above the IRA contribution limit in 2025, you can withdraw that $1,000 before the due date of your return. This would qualify you for this exception to the penalty.