Honestly your example is about as useful as me saying investing in stocks in general is bad, because sometimes, they go down. So what? We're talking about broad long-term averages here, nothing more.
It's fine to argue about personal psychological preferences, but as I say, this purely a mathematical statement I am making here. It should not be controversial, but it always is.
No offense but I'm pretty surprised you commented what you did. Literally my first sentence says "... before interest hits...".
But regardless I’m just saying you can use a credit card to buy time interest-free before you pay off the emergency with your salary/stocks/whatever. It’s better than taking a margin loan, no?
i mean that's not really an emergency.
An emergency is one such that if you weren't prepared for it, you can't handle it. For example, losing one's job can be considered an emergency (a short one, if you're in high demand).
A medical emergency is a good example of an emergency - to which you prepare for by purchasing insurance.
So by saying that a person's portfolio would perform better by ditching the emergency fund is just the same as saying 'take on more risk and get more return'.
You have $100k. Put all of it in the stock market. The stock market drops by 40%, your investment is worth $60k and you withdraw $20k. The market goes back to 100% and now you have $67k in your portfolio.
If the market dropped by 80% your portfolio would be gone entirely. Meanwhile if you had enough emergency funds you would have kept everything.
The worse the emergency, the higher the ROI of the emergency fund. Since there is no upper bound for how bad an emergency can be the theoretical ROI of an emergency fund is also unbounded.
In this comment the definition of an emergency is a stock market drop combined with unexpected unemployment.