He only realized that upon arriving here in Brazil. After phoning the airport and having a friend from LA walk there. He got hold of the real owner of the laptop (he noticed before flight and filled a missing item request at the airport). After some back and forth they managed to exchange their laptops back over FedEx.
So in the end, nothing but money was lost as they both got hold of their own laptops back but this should have never happened in the first place if the TSA or whoever is in the scanning machines took care of what is happening. If we can put with all the trouble regulation and schemes, they can do a better job of paying attention to the process. There are more than one person per machine already...