The electronic configuration of thorium ($Z=90$) is $5\mathrm f^0 6\mathrm d^2 7\mathrm s^2$. But, according to the aufbau principle, the electrons should first enter the $\mathrm f$ subshell and not the $\mathrm d$ subshell. This is not a special case of a half-filled subshell or a fully-filled subshell like we see in the respective cases of chromium and copper. Then why do we write the electronic configuration like this, first filling the $\mathrm d$ subshell and not the $\mathrm f$ subshell?
P.s I came across the anomalous configuration of thorium here: https://en.wikipedia.org/wiki/Thorium#cite_ref-Wickleder5960_19-0
But it doesn't state the reason for the anomaly.