Both are correct and perfectly good English, but in both sentences, the middle section (rest in piece) should read: may he rest in peace:
My grandfather, may he rest in peace, loved to watch/loved watching cartoons.
That is how native speakers of English would say it, and there's no 'logical' explanation, except to say that is how we say it when we wish someone well, whether they be alive or dead, e.g. may you have a safe journey, may you soon recover, may her soul rest in peace, etc. It is the same as saying 'I hope you have/will a safe journey/will soon recover'.