Yes, it is better to choose to invest instead of betting because it can provide better results, namely profits in the future. Maybe by playing gambling, we can also get a win, but the chances will not be greater than defeat. And I agree to invest or bet on an amount we can lose.
But from that story, we can learn that if we get a big win, we have to hide it from the public and not even tell it. That's to avoid overexcitement and may make us feel uncomfortable.
They both have a level of risk, while gambling can make you lose all, there are some types of investments that can make you lose all your capital, hence the reason why everyone should always apply caution before making any decisions. There are some capital/funds that cannot be used to start an investment, you will be left with no choice but to gamble your way out to have some changes in the wallet, it is not every time we get the opportunity to invest.
Gambling may be 50/50 and I am not yet there to say gambling makes a life but I have heard and seen colleagues use gambling money to do what investors have not done in years with the slight opportunities they cash out from, they don't win consistently big but whenever they do, you will appreciate the patience of been in gambling because it worth it.