You take both passport with you on return and show this to Immigration.
Your passport might be invalid but the Thai Extension of Stay and Re-Entry Permit stays valid to use.
You will get the entry stamp in your new passport. After arrival change of work permit can be done at Ministry of Labor and transfer of Extension of Stay/visa info at immigration.
You can not convert or change the reason of a used and invalid Visa inside the country.
If you want to be inside the country using the Non Immigrant B visa you have to leave, apply at a Thai Embassy and return using this new visa.
Check the websites to the Thai Embassy which you like to visit, some Embassies only work on appointment and Singapore has an online application, you can also see the requirements to obtain a visa.
And before the discussion start about the requirements and the income of Digital Nomads, there is a Digital Nomad Visa official called the Non Immigrant B visa.
But be aware people do need to pay tax if they work legit in Thailand.