Because you repaid an amount you thought you had an unrestricted right to and which may have been included in income (up to 85%) in an earlier year, special rules apply. The repayment will be netted against current benefits; only report as income any excess current benefits shown in box 5 of Form SSA-1099 (up to 85% of benefits, determined under the special rules for figuring taxable Social Security benefits). None of the benefits are taxable if the repayment is more than current benefits (box 5 of Form SSA-1099 shows a negative number), and if the negative amount exceeds $3,000 and it covers benefits that you included in income (up to the 85% maximum) in an earlier year or years, you may be eligible for an itemized deduction or tax credit in the year of repayment; the credit is figured by recomputing the tax for the prior years. If the negative amount is $3,000 or less, you’re out of luck; before 2018 it would have been treated as a miscellaneous itemized deduction subject to the 2%-of-adjusted-gross-income floor, but this deduction is suspended for 2018 through 2025.
A revenue ruling is the Commissioner’s “official interpretation of the interpretation of the law” and generally is binding on revenue agents and other IRS officials. Taxpayers generally may rely on published revenue rulings in determining the tax treatment of their own transactions that arise out of similar facts and circumstances.