Were you working in the same place before and after the missing years or was it a different employer where you worked only for those two years. Have you any other evidence as to where you were working and how much you were earning, i.e. bank statements??
HMRC/DWP do make mistakes, especially going back in time so long. It was the days when HMRC/DWP would manually enter payroll details from end of year returns, often submitted on paper, by employers, so there are many points where mistakes could have been made, i.e. wrong national insurance number keyed in, wrong figures entered on your record, etc. Or the mistake could have been the employer - i.e. same kind of thing, wrong Ni No on the paperwork, etc.
HMRC/DWP won't have the paperwork going back 20 years either, so it's not as if they can send someone down to the archives to dig around for the paperwork!
Sometimes they'll adjust your earnings history/record if it's clear you were working and earning enough to qualify for NIC credits so it's well worth you ringing them to highlight the problem and see what they suggest.
Otherwise, it's a matter of paying for the missing years IF you need them, i.e. if you're not going to have enough qualifying years anyway by the time you retire. If you've been working pretty steadily for a full working life, with only "time out" for caring responsibilities where you'll have been eligible for credits for a number of years, then you may well end up with full state pension anyway, even without paying for the missing two years.