Even if you're going to be in the same tax bracket when you retire, I'd rather have my investments in taxable accounts than a 401k. Tax deferral of gains - which are then taxed at ordinary income tax rates - may not be better than paying taxes on the investment now, but paying much lower qualified dividend/ long term capital gains taxes later.
Maybe I'm misunderstanding you, but this seems to be a very misguided statement. Ignoring fees, tax deferral of gains will never lose to paying taxes now (at the same tax bracket) and then paying capital gains tax. To illustrate the point, say you have $10k with which to invest, earned income is taxed at 25%, and capital gains at 15%. Using tax-deferred, you invest the full $10k, but if using after-tax you can only invest $7.5k. Over the years, the investments double, at which point you want to withdraw the funds. For the tax deferred, you pay 25% on $20k, leaving you with $15k. For the taxable, you have $15k but then have to pay 15% on the gains, leaving you with $13,875.
Your example is fine. However, you are incorrect that tax deferral of gains will never lose to paying taxes now, though.
As a counter example, say you're currently in the 12% tax bracket, and plan to be in retirement (not an uncommon situation). Again, we'll use 10K as your investment example.
401k:
10K invested doubles to 20K. When you withdraw it, you take away 12% in tax, leaving you 17,600.
Taxable:
10K taxed at 12% leaves you 8800 to invest. It doubles, but since you're in the 0% qualified dividend and long term capital gains tax bracket, you pay no taxes on the gains, leaving you with 17,600.
In this case, the two are the same, which is what I said originally: " tax deferral of gains...may not be better."
But, it's pretty easy to imagine cases where tax deferral of gains is worse. One example you alluded to: you change tax brackets. This can happen when you start to receive Social Security, you start having to collect RMDs, or you start receiving a pension. Another example, without changing tax brackets: an intermediate loss! To wit:
401k:
10K invested doubles to 20K. When you withdraw it, you take away 12% in tax, leaving you 17,600.
Taxable:
10K taxed at 12% leaves you 8800 to invest. The market crashes - oh no! Your investment, on paper has fallen in half. You're smart, though - you sell and immediately repurchase. Your loss you can exclude on your current taxes (it'd actually take 2 years, but I hope you'll forgive this approximation), and, since you're smart, you invest the 4400 * 0.12 = $528 in tax savings.
Then, to get to the final doubling from the 401k example, we have to quadruple the (4400 + 528) = 4928, times 4 is $19,712. When you withdraw this in retirement, since you're in the 0% qualified dividend and long term cap gain tax bracket, you get to keep all $19,712. You finish $2112 ahead of the version of you that invested in the 401k.