It's a bit confusing when trying to understand what's the difference between UnknownTopicOrPartitionException (retriable) and InvalidTopicException (non-retriable).
Looking through the code to figure out what's an invalid topic I see most tests that throw it describe it as "illegal". This is also the case when trying to write to an internal topic. While a longer discussion around having an invalid topic _name