Analytic bootstrap of mixed correlators in the $\boldsymbol{O(n)}$ CFT