Sounds like for some reason immigration wants you to start the visa process from there beginning, therefore telling you to go out of Thailand and come back on visa exempt or tourist visa (depends on your nationality).
You don't have to wait for the visa to expire, just go out of Thailand WITHOUT a re-entry stamp, and when you get back just go to immigration and convert your permission to stay (that you were stamped in) to retirement, but make sure you have all documents ready.