Your supposed to get a letter from your employer when you leave your company stating your last day and give it to immigration and notify the Dept of Labor as well. Then leave the country within 24 hours and either get new Visa if you wish to return or move on somewhere else outside of Thailand. If you can’t get back home to your country I would think you would be covered under the amnesty rule.
You need a letter signed by your current employer stating you are terminating your employment and present that to immigration. You also have to cancel your work permit. Don’t believe your agent. It could affect future Visa/work permit requests. As these are special circumstances there could be some latitude though.