You assumed the same rate of growth in both accounts, which is likely wrong.
A 401(k) doesn't give you many choices.
If yours has low-cost index funds in all the major market areas (large-cap growth, large-cap value, mid-cap growth, mid-cap value, small-cap growth, small-cap value, government bonds, corporate bonds) then it can be a good option. But beware, your money is stuck there for the duration of your employment, and your company has no obligation to offer you the same funds at the same expense ratio next year as you have now.
On the other hand, an IRA is yours to invest how you like, with any brokerage you like. So an IRA has all of the above choices available at expense ratios of 0.08% or less. As well as the possibility to invest in individual companies, or in market sector ETFs, or use leverage, or trade options.
The difference in expense ratio between 0.80% and 0.08% may seem unimportant compared to the differences in tax brackets... but you'll pay the taxes once, and you'll pay the fund expenses every year for nearly 30 years.
In addition, it is advisable to save part of your retirement in Traditional (pre-tax) accounts, and part in Roth accounts. For this part of the discussion, a Roth 401(k) can serve just as well as a Roth IRA. This is both to hedge your tax exposure (What if the government increases every tax bracket by 10%? What if they decide to break the promise that Roth earnings will never be taxed?), and also give you flexibility. Each year in retirement, you'll need to take the required minimum distribution from your pre-tax retirement savings, but the rest of your income you can choose to take from either pre-tax or Roth, so you can optimize tax burden over a number of years. In particular, you can avoid paying in a high tax bracket simply because you had to withdraw a large amount in a single year to handle an emergency. Or taxes might be extraordinarily low for a short time, because a particular Congress added a new deduction that applies to you, and you don't expect it to survive the next election, you could choose to pay taxes in the favorable year by doing a (probably partial) conversion to Roth.
Combining these two effects, the rule of thumb to max out the Roth IRA contribution each year after meeting the 401(k) match is probably the best approach for 90% of W2 employees. (The investment options are different for self-employed and contractors, as well as owners.)
If you were to withdraw from the 401k at a rate that fell into the 24% tax bracket, then the accounts effectively have the same amount of money in them.
That's false, because tax brackets apply sequentially.
Notably, tax deductions for making traditional 401(k) contributions (and deductible traditional IRA contributions where applicable, but usually you can't) save you tax money at your marginal rate (or perhaps one bracket down). But when in retirement, some of that money will be withdrawn at the 0% (i.e. the standard or itemized deduction total), 10%, and 12% brackets, or whatever the lowest brackets are in the future. So, all other things being equal, taking the deduction now will tend to be better.