This is used to show when someone is confident that they have the right answer even though they are usually wrong. It is usually used in the context of talking about another person's attitude or personality, and it is generally a negative thing to say about someone. For example, you might say, "My boss is so annoying. He is often mistaken, but never in doubt. He really has no idea how us workers do our jobs."