  In this paper, we present a new analysis on the $P$-wave charmonium
annihilation into two photons up to next-to-next-to-leading order (NNLO) QCD
corrections by using the principle of maximum conformality (PMC). The
conventional perturbative QCD prediction shows strong scale dependence and
deviates largely from the BESIII measurements. After applying the PMC, we
obtain a more precise scale-invariant pQCD prediction, which also agrees with
the BESIII measurements within errors, i.e.
$R={\Gamma_{\gamma\gamma}(\chi_{c2})}
/{\Gamma_{\gamma\gamma}(\chi_{c0})}=0.246\pm0.013$, where the error is for
$\Delta\alpha_s(M_\tau)=\pm0.016$. By further considering the color-octet
contributions, even the central value can be in agreement with the data. This
shows the importance of a correct scale-setting approach. We also give a
prediction for the ratio involving $\chi_{b0, b2} \to\gamma\gamma$, which could
be tested in future Belle II experiment.
