The term you are looking for is "anosognosia" from the greek "ανοσογνωσια" which is a composite word meaning ignorance/lack of knowledge of one's illness. The term was coined first by doctors who observed patients who had suffered a stroke, but the part of the brain that had gotten damaged was the same part where the knowledge that they had suffered the stroke also resided. Thus when asked "How do you feel today?" they sincerely responded "I'm great!", despite the fact that they could not move the entire left side of their body.
Psychologists then extended the term. They gave a knowledge test to a group of people and afterwards asked them how they thought they had performed. After grading the tests they observed a very clear correlation. Those who thought they had performed pretty well, actually had average or below average scores. Inversely those who were more cautious regarding their estimates, had achieved top scores.
The conclusion was that the skills missing from those who scored poorly, where exactly the same skills that would have led them to a better judgement when asked how they thought they had performed. In simpler terms: I'm poor at math => I score poorly on a math test & and that same lack of math knowledge is also what hinders me from passing the correct judgement that I actually performed poorly in the first place.