And the issue is that it's not easy for countries to tax their citizens the way you have explained, though it's viable for you to prove you gained or lost. However, some would still evade tax through that as there are many schemes through which they do this, especially when they could gamble online, and with crypto.
This is why a country that wants to tax its citizens always has arrangements with the gambling company, they might tax your ticket directly or have the record they will duplicate for the government in order to know how to tax you. But one must be living in their country for the latter to be effective.
Either way, it depends on the country, but you shouldn't be taxed if you are not gaining.