There are essentially multiple levels of meritocracy. A level 1 meritocracy would judge only by current skills - for better or worse. This may be less than impressive even if technically a meritocracy. It may say, result in most knights coming from noble families trained from birth, but exceptional individuals would not be barred just from their background. Strictly better than a hard caste system but not something to brag about. A level 2 would try to ensure some degree of access to skills and education to all and be more meritocratic. Public education of unequal qualtity would qualify. A theoretical level N would involve completely equal starting points and would thus have pure 'merit' as the decider, even if it only accumulated from luck and the normal curve. Which highlights another issue - the distribution of quality is never perfectly even, it tends to follow a normal curve of some sort.
As for 'solving' the issue. Ability begets ability - this is called education and practice and I doubt there is a true alternative. We would call it rightfully barking mad to ban education for the sake of equity despite education contributing greatly to disparate outcomes. I think that is one of those imperfections of the universe we must accept for now.