Because neither of tan x nor sec x are defined at 270 degrees, the original derivation of your quadratic in sines does not apply (good job btw) so it's not a valid solution.

(Note you also have 30 + integer multiples of 360 degrees as solutions as well.)

Try plotting tanx + secx and 2 cosx on the same graph and see what it looks like. Note the singular point at to see what I mean.