If you have attempted to file your federal return prior to the filing due date (April 18. 2022 for 2021 returns) and it was sent back for correction, you have until 5 days to have it corrected and still be considered on time.
If you are due a refund, there is not a deadline or penalty imposed. The due date is primarily for paying tax due. You can submit your online return thru October 15 without filing an extension when you are due a refund. You have three years to claim your refund thru the mail after that.
If you owe the IRS taxes, you can still submit your online return until October 15, but if you did not send the money to the IRS by the filing due date (April 18. 2022 for 2021 returns), you may have penalties and/or interest assessed. An extension allows more time to file without penalties, not more time to pay.
The software does not figure penalties and interest for you. The IRS will send you a bill or you can calculate the amount and add it to the amount you owe. The extension deadline is April 18 2022 for 2021 returns.
As for the state return, each state has different rules and you need to confirm with your particular state but federal extensions are accepted by several states.