It's not a lie or a joke, it's when the speaker doesn't know that by saying what they said other people can figure out they don't know something.
"Dolphins are my favorite kind of fish."
This reveals the speaker does not know that dolphins are actually mammals, but would suggest they probably know very little about fish, mammals, or even animals in general.
Instead of having to say, "You just said something that reveals to me that you are ignorant in something", I would want to say, "You just committed a _____".
I always want to say you "jumped the shark" in your statement, or you committed a "faux pas", but those aren't correct.