I mean I guess that goes without saying but nowadays, it's a little bit more nuanced than just "borrowing money for investment bad, not good you shouldn't do it bs" cause for instance, if you had to borrow money to fund whatever venture you have, whether it be for investing or whatnot, and you tried your hardest to come up with the capital on your own but just can't, all the while being confident in thinking that doing or going for this venture is the right thing to do, not doing it is going to cost you more than just losing it overall. Cause if you lose the money you used for investment, especially if you borrowed money from a bank, I would presume there are ways you can repay them, but the prospect of losing out on a life-changing sum just cause you were afraid to take the risk is going to eat at you more than the losses you would incur, trust me.
Besides, the rich people does this all the time, and that's what makes them rich, they borrow money from a bank for example, use that money to set up businesses, buildings, you name it, and pay the bank back with the money they owed them, while keeping the business running at the same time. So what makes you think the average joe can't do this shit too?