Entry into Malaysia.
You exit Thailand with a " Valid" Thai entry stamp in 1 passport and enter Malaysia with a second passport. Now Thai & Malay Exits compare you with your entry photo. Now does it work if your exit / entry is land, sea or rail. I doubt remote border post are connect with the main airport servers.