Sometimes it's laws that says that foreign born humans can't own the property but a randomly made business could.
Sometimes its the fact that the property has a 100yr lease, but then someone sells it but you are actually just buying the last 20yrs of a lease.
Sometimes it might be that you can't buy the property but you can lease it.
Sometimes it might be that it zoned for grape and if you don't produce 10kg of grape in the last 10yrs then it get reverted to conservation land.
All the above are easy to deal with as long as you know up front.
Alot of times the person who inherited it and is trying to cash out, don't even know the rules vs you as a foreigner.
Then their are things like if you try to get a permit to fix the roof, they might say that the building is unsafe and need to be demolished. But if you just fix it without reporting it. You would be fine and even if they come, it wouldn't be classed as unsafe and to be demolished, but you might have to pay a small fine.
I know that in Spain specifically if you buy/mortgage a house that is worth $500,000. You get a investor/work visa, and in few years you can apply to be a EU/Spain citizen. Not a bad way to have a 2nd passport. All while using the banks money.