If it’s not valid, then it should not exist. People should not be required to know this obscure piece of information found in some random thread to figure out how to post on this forum. Or in other words, there should be no possible combination of post form settings that could ever result in error message before posting.
If there are categories that are invalid to post in, they should not show up in the category autofill.
If there is a category where certain tags do not apply, those tags should not show up at all either.
Sanitizing the post settings to correct state should be responsibility of the website backed, not the user.