Yes, the example sentence is grammatically correct, even with "is is", and yes it has the meaning you reduce it to.
The subject is, "What I think the purpose of life is". This is a noun phrase. The main verb is "is". The subject complement is "to live happily with our loved ones".
Here's some more examples with video clips:
The only thing there is is cognition
What it is is the National Park Service is providing staff...