I'm not entirely sure that information is accurate. Social Security is based off your highest 35 years of earnings (which are SSA-eligible) and you must earn 40 "credits" at 4 credits per year (so, 10 years working) to be eligible for any benefits at all.
About 35 states have a different retirement system for teachers, avoiding social security entirely for them.
However, there are provisions for people who have worked both as a teacher and in other jobs. In this case, your Social Security benefits will be reduced by the amount based on the retirement benefits you receive as a teacher.
I am unable to locate any information that states you must have paid into SSA for the last 10 years, and I believe this may be erroneous. It appears you may be confusing this with Social Security Disability benefits, which are not the same as ordinary Social Security (retirement) benefits.
I recommend you look for a second opinion. You are very likely not at all out of luck.