This only works if ALL things happen.
-You have the cash to buy outright.
-You have an investment that you can reliably withdraw the funds from.
-There isn't risk to losing principal with the investment.
-The investment outpaces inflation + interest. If inflation is 3% in your example you just lost .6%.
99% of the time these things aren't true for the 5-7 years of a loan.