This is a solved example from my textbook: $\DeclareMathOperator{\csc}{cosec}$
Ex. 11: Find the general solution of $\cot x + \tan x = 2\csc x$.
Solution: As given \begin{align} && \cot x + \tan x &= 2\csc x \\ &\therefore& \frac{\cos x}{\sin x} + \frac{\sin x}{\cos x} &= \frac{2}{\sin x} \\ &\therefore& \frac{\cos^2 x + \sin^2 x}{\sin x\cos x} &= \frac{2}{\sin x} \\ &\therefore& \cos^2 x + \sin^2 x &= 2\cos x \\ &\therefore& 2\cos x &= 1 \\ &\therefore& \cos x &= \frac{1}{2} \\ &\therefore& \cos x &= \cos \frac{\pi}{3} \end{align} $\therefore$ the required general solution $x = 2n\pi \pm \frac{\pi}{3}$, where $n \in \mathbb{Z}$.
As you can see, they have cancelled $\sin x$ in the denominator. Is that causing loss of a root here? Is $x = n\pi$ a solution?
You start with the equation $\frac{\cos x}{\sin x}+\frac{\sin x}{\cos x}=\frac{2}{\sin x}.$
This equation is only defined for values of $x$ such that $\cos x \ne 0 \ne \sin x$.