Revert "Only do formula class sanity checks once"

This reverts commit ace78b1f3a59a893c7068e485555acf792470080.

Fixes #30154.