If the second owner has a properly registered conveyance deed the property belonged to him and so your grandfather's purchase from him is correct,again if backed by a registered conveyance deed.
DISCLAIMER : General information and advice provided is without any warranties as to suitability for any use, correctness and application to any specific case. Please always take proper legal counsel . However, if it helped anyone even a little a " thanks" would be appreciated and would encourage me to keep on making efforts :-) . I am also always open to corrections and further learnings from more experienced Seniors here.