Where are you getting this 12% effective rate from? Are you intending to withdraw from the HSA directly at retirement for non-medical use, like a Traditional IRA?
I mean, I realize that's what the topic says, but I took that as meaning "withdrawing from HSA as I incur expenses" vs "leaving invested and withdrawing from HSA using previously-saved-up receipts once I actually need the money." I don't recall seeing many articles proposing use of an HSA with no intent to ever redeem medical expenses from it.
Most people that use an HSA as an investment vehicle are taking advantage of having no tax going in OR coming out by keeping copies of all medical expense receipts from now until they need to tap into the HSA far in the future, planning to redeem all the receipts once the investments have grown substantially (there's no limit on how long you can wait to redeem an expense as long as the expense happened after the HSA was opened - I suggest tracking them in a spreadsheet and keeping digital copies of the receipts on a Google drive or something).
That way you aren't taxed at all, BUT by waiting to redeem until years and years later rather than redeeming the moment you have the expense, you give the investment time to grow. The 12% tax at the end wouldn't apply, and the HSA is the clear winner as you said. Using it like a Traditional IRA is more of a backup plan if somehow you manage to not have enough medical expenses before your other retirement accounts run dry and you need what is in the HSA (and if you do that, then yes you are correct that just just like a tIRA its value depends on future dividend/capital gains tax rates since all you are doing is deferring taxes until later).
Do you really think between now and your death you won't have any medical expenses, especially with the HDHP you need to even have access to an HSA? There's just really not much reason I can see to withdraw the funds directly as long as you save all your medical-related receipts from now until you actually need the money. You don't even have to file the receipts or really in any way prove that you actually are using the funds for medical expenses, just have to have the receipts on hand in case you get audited after redeeming them. There's also a surprising amount of things that qualify as a medical expense, you should check over the list on the IRS site!