A man did this in Sydney fairly recently. He discovered a vacant house whose occupant had died, changed the locks and tidied the property before renting it out to other people. After 20 years he applied for the deed. Relatives of the deceased owner were tracked down, and tried to fight him in court, but he won.
He got to keep 20 years of rent payments and a multi-million dollar property.
https://www.smh.com.au/national/nsw/developer-wins-court-bat...