I think the only comparison I can make between trading and gambling is that you can lose a lot of money, and that in both activities, as a player/trader, you must have money prepared to lose.
Otherwise, I don't see any comparison, because trading should be done because you know what you're doing, and you can lose even with analysis. Gambling, on the other hand, is almost 95% pure luck.
If you don't use your skill in trading and only predict, you can lose huge money. But if you can analyze the market and know what you need to do, you will prevent the loss and make a profit.
Besides that, it is right you can lose your money in trading but you can recover your losses when the market is back to normal. So you can make a profit only if you use your skill and that is different than gambling. You can loss huge money in gambling but you will difficult to recover your losses.
We don't have to compare between gambling and trading because that is different. But both can make us loss too much money especially if we chase or recover our losses.