The WP_Error with the code invalid_taxonomy appears when WordPress cannot find a registered taxonomy that matches the slug supplied to a term function. This happens because the taxonomy registration did not occur, the registration ran too early, or the supplied slug does not exactly match the registered name.
The error stops term queries, hides taxonomy meta boxes, and returns empty term lists. It signals a mismatch between the code that requests terms and the taxonomy definition stored in the database.