You're right. Your 401(k) can't tell. If you are trying to deceive your 401(k) that's a fine strategy. But your pay stub can tell, because if you were buying a bond in your 401(k) it would be with pre-tax dollars. Instead you are buying the "bond" with post tax dollars. Big, big difference. And your net worth can tell too. And it knows it isn't increasing. Even if you want to think of it like a bond, it still isn't at all like having a bond in your 401(k).
Your 401k is buying a bond-ish device with pre-tax dollars.
I guess the question is if you are more worried about your 401(k) knows or your net worth knows? I know which one I'm more worried about.
How do you think an 18% auto loan makes your net worth feel?
Now, I agree that in some circumstances a 401(k) loan might be the best thing to do. And the OP might be one of those cases. Sometimes you have to chew off a leg to get out of the trap. But he is lying to himself if he looks at it like having a bond in his 401(k). It is completely unlike a bond. Bonds are assets. The loan is a liability that he is responsible for.
It is an asset to his 401k, it pays better than a 30 year treasury bond.
And as you point out, the full amount of this liability is callable in some circumstances. One of which is losing your job, another of which is failure to make the loan payments. Since the OP is already having trouble making payments...I'm guessing more loan payments won't help much.
Payroll will take it out of his paycheck before they pay the OP. The OP would have to quit or get fired to not make payments.
In exchange for taking that risk, the bond doesn't actually pay you anything. You get exactly zero return on investment. Might possibly be the shittiest bond that was ever floated in the history of bonds.
In exchange for taking the risk the 401k gets to collect a 5.25% coupon and the OP gets to pay himself 5.25% instead of a bank 18%.