I mean I’m not saying you should go get a high interest loan that would force you into bankruptcy and drop it into SPY and hope for the best, but sure, if you have access to cheap capital and a huge runway to recover.
For instance you can take out a mortgage and then instead of paying it off as fast as you can, investing your free cash flow. That’s the same thing, but when presented that way it seems far less offensive.