> The thing is that there was a land transaction that happened while he was squatting
Yep, there is a thing called “due diligence”
My guess is that the previous landowner is the actual bad guy here—giving verbal permission to the squatter, hiding it from the new buyer....
But—it would be helpful to know if that was really true or not.