Often what appears to be a "sudden" decline is in fact a gradual deterioration that eventually reaches a point of unsustainability. Sort of like when someone says they simply leaned over to tie their shoe and their back "suddenly went out" — in fact some musculoskeletal dysfunction had been present for months or even years. Some plants have an amazing ability to withstand adverse conditions for a long time, but eventually they succumb if the conditions don't improve. It's impressive that your plant survived so long 10 feet from the window, but aside from the recent drooping, the overall structure shows unmistakable evidence of long term light deprivation. When you decide to repot next time, use a mix formulated for cactus & succulents.