Praise be to Allah.
If your grandfather had given you permission to do that, and he was in his right mind and aware of the consequences that would result from his giving you permission, then you are not liable for what resulted from that of his being deprived of his pension.
Al-Kaasaani said: The one who is given permission is not liable for the consequences of an action for which he was given permission.
End quote from Badaa’i‘ as-Sanaa’i‘, 7/305
As-Subki said: Approval of a thing means approval of what results from it.
End quote from al-Ishtibaah wa’n-Nazaa’ir, 1/152
Ibn al-Qayyim said: The one who is given permission to do an action is not liable for the consequences result from it.
End quote from I‘laam al-Muwaqqi‘een, 2/33
Shaykh Ibn ‘Uthaymeen said: A person is not liable for anything that may result from an action for which permission was given; if no permission was given, then he is liable.
End quote from Manzoomah fi Usool al-Fiqh, p. 15
If your grandfather was not aware of anything at the time when you registered the company in his name, then his consent is not valid, according to sharee‘ah.
As you were the cause of his losingof his Social Security pension, then you are liable for his pension for the five years during which he stopped receiving it. Liability usually occurs when damage is caused to something or its owner is caused to miss out on its benefits.
Shaykh al-Islam Ibn Taymiyah said: Damage is of two types: damaging something that exists or causing the loss of benefits of something that did not come about when it should have been there.
End quote from al-Fataawa al-Kubra, 5/406
The total sum of money should be distributed to his heirs in accordance with the shares dictated by sharee‘ah.
And Allah knows best.