I believe the word you’re looking for is non sequitur.

From Vocabulary.com:

A non sequitur is a conclusion or reply that doesn't follow logically from the previous statement.