Hello, your granddaughter is all right. Just young children are prone to mood swings. Sometimes the baby just does not know how to behave and what to expect. After all, the main thing for him is that his mother was near, and that the environment remained unchanged.
The desire to attract the attention of relatives and relatives makes them behave provocatively. And why not cry and run away, or, conversely, climb on the handles and kiss. Kids perceive all this as a game, otherwise it is called "inconsistency of feelings." The emotional palette of a child 1.5-2 years old is very limited in emotions. And if he suddenly does not like something, he cries and hysteria, and if he is satisfied, he laughs.
We are often saddened by the fact that our beloved child, smiling a minute ago, is now crying and crying or hiding in the next room. Try not to be angry with him, but be always there, showing that you are in the access zone, because the kid is watching you. And if you wait a little, you will see that, having adapted to your presence at home, your granddaughter will definitely want to play with you and give you her smile.