That is quite convoluted. A simpler way to get the same result and ~10x faster.
AssociationMap[FormulaData[#, "Classes"] &][FormulaData[]] // Values // DeleteMissing // Flatten[#, 1] & // Union
That's much simpler and easier to read and understand.
I would use Values on an association of the last line and then Union to delete duplicates and order them.