my own experience in Thailand, was that i continued to pay uk tax via paye and my employers tax consultants kpmg yearly managed the tax returns in both countries, claiming back 100% of uk tax and settling the Thai tax bill on earnings not remitence.
but to that originally you had to declare which country you would be living, and the expectation is you would pay tax for the amount earned in the new country of tax residence. This is acceptable for countries on global tax system, not for countries on remitence tax systems. If you've recently moved to Thailand from a third country you probably need to consult a tax advisor to understand the implications of the move on your tax status. If Thailand moves to a global tax system (being discussed) everything works as you said and we can elect to opt out of at source taxing in the UK, and elect to pay all the taxes in Thailand if there is an advantage.
pretty sure this is only where you will be tax resident in a country that has a global tax regime. As Thailand is a remitence based system the UK gov are reluctant to issue a tax exempt code. Eg you earn 100k in uk, pay no tax, only move 25k to Thailand and pay tax on 25k, you've got 75k tax free if you spend that not in Thailand, which isn't acceptable.
technically you have income of 800k, which cant be treated as a gift, and unless it has supporting documentation for a structured loan, term, interest rate etc cant be treated as a loan. You have no tax credits from your home country for it so the 800k is assesable income and subject to tax. The first time maybe ok based on your tax residency, but the second year and subsequent years you are probably a tax resident.
that should be a last resort, as your paying them big bucks to borrow the money for a day, not adhering to the terms of the extension, and have to repeat the visa and extension process the next year via an agent, and you could owe the government upto 240k in tax everytime you do it.
Personally i would ignore the fact you have a work permit and carry on using the 400k method (unless you have problems holding that), its a lot less paperwork.