This mistake has been made many time throughout history. Cocaine was originally believed to be a viable treatment for depression. Opioids and amphetamines too. You take them and you feel good for a while, which was mistakenly equated with treating depression.
Many drugs will make you feel good temporarily by blocking certain feelings or tricking your brain into feeling good. This is not the same as treating a condition.
You can think of actual treatments as working closer to the source to reduce the problem, not temporarily overriding it with a powerful drug-induced sensation.