Insomnia can be a warning sign of an underlying medical problem.
There are specific strategies to safely taper off of antidepressants.