@Philip ****
no you don't need to transfer the re-entry permit into the new passport, because it becomes void anyways on the day after you have departed Thailand. You won't be in any overstay. I don't know who told you that you would be in overstay. Your second year out of a former Non-Imm-O/A visa will expire on Augsut 27th, the day after you left Thailand. You are then free to start the process again in your home country