In 2017 it wasn't possible (see post below from this group). Of course, things could have changed, but if I were you I'd go to the immigration office at Samui when (or before) they open today to get that re-entry permit.
which is only useful if you never ever travel out of the country, because as soon as you do the 90 day counter is reset and the email reminders will be out of sync with the real reporting date.
That stamp in your passport (not a visa but an extension) means nothing once your work permit is canceled. Find out exactly when your employment ends (ie what date will they put on the letter) or perhaps negotiate this date with HR if you're on good terms with them. That will be the day your work permit needs to be canceled as well as your visa extension. Some immigration offices will let you do this in advance (eg Bangkok) while others do not.
2-3 months before your extension expires, you can start the checklist of things you need to get a retirement extension (e.g. seasoning of funds in your bank account). Your work permit expires on your last day of work, as does your Non-B extension (no matter the date mentioned on them) and they need to be cancelled at immigration, so what you do is you make sure you satisfy the list of requirements for a Non-O retirement extension and get it at your local immigration.
It totally depends on your immigration office if they'll let you do this before the last day of your employment, e.g. in Bangkok they might allow you to do so 1 week before your last day of work but in Nakhon Pathom (speaking from personal experience), they want you to come on your last day of work.
You probably hold an extension, not a visa. When you stop working, and if you qualify for the extension based on retirement, you can change the reason for extension from employment to retirement. I don't think you need to leave the country for that, but you'd best check that with your local immigration office.
I'd say you don't need to fix anything if you leave the country before the 15th of Feb 2024 and re-enter (using a re-entry permit). Make sure to alert the officer to the mistake when you re-enter and ensure you get stamped in correctly. Caveat: this is my personal opinion, not based on anything other than common sense.
Alternatively, you could go back to Suvarnabhumi and have it corrected, as CM immigration would almost certainly be unable to do so.