To be eligible for Medicaid, you need to have very low income and few assets other than the home you live in, and you must be either at least age 65 or disabled. (There are also other categories of eligibility, which vary from state to state.) If your current Medicaid eligibility depends on your status as "disabled," your state's Medicaid program may want to have the Social Security system determine whether you are disabled under their guidelines. Your state Medicaid program may also want you to receive Social Security disability benefits, which may or may not mean that your income would then be too high for Medicaid eligibility.
But there are two different parts to Social Security disability eligibility. One part is the determination that your are physically or mentally disabled, meaning that your condition doesn't permit you to work and earn over a certain amount per month. But the other part of Social Security disability benefits eligibility is having enough work credits (which you earn by having your employer or yourself pay Social Security taxes on your income), based on your age, to qualify for benefits. In your case, Social Security determined that you didn't have enough recent Social Security work credits to qualify. But that doesn't have anything to do with whether you do or do not have a disability that would permit you to qualify for Medicaid (assuming your income is low enough). So, the fact that Social Security denied you eligibility for disability benefits on the basis of too few work credits should not affect Medicaid's decision about whether your are sufficiently disabled, under the state Medicaid program's rules, to qualify for Medicaid coverage.