It's a good question. You have to take all possibilities into account.
You are not clear on who has custody of the kid. First you say she lives with the gramps, then you say she lives with them part of the time and with her mom for a part of it. If the gramps have custody, then can do whatever they want but if the mom has custody, she has the say over the kid. Taking somebody elses kid to a doctor (because it's not him doing it, it's his parents) is not like taking them to the park. If the mom finds out, she might get so furious she will do her damndest to make sure the gramps never see that kid again. That will not help his relationship with his child.
Of course there is also the possibility that she'll never find out.
How old is the kid and is she a chatterbox? If they still want to go behind the mom's back, it might be a good idea to fool the kid too. Make up a reason why she has to go to the doc. Then if she tells her mom about it, there will be an explanation other than "just because" or "for immigration to Canada"