This baptism should not be considered valid. The guidelines for laity baptising are very strict, and even more strict for again the parents wishes. These guidelines were not met. Either the children shouldnt be recognised, or should and the grandparents excommunicated
As 1ke pointed out, the putative baptisms weren’t licit, but if the OP guessed correctly about what the grandparents did, the conditions for validity were probably met. I think it most likely that the OP is right, but I suppose it is possible that they “played” at baptism in order to make the children desire to have it, because they knew they could not licitly baptize the children themselves. (I know grandparents in that position, who teach their grandchildren about the faith and would love to just secretly baptize them, but who know that they may not do so.) If they showed the child how a baptism is done, but did not intend to confer baptism, then it was not a valid baptism. It is not possible to baptize unintentionally.
As for excommunication, people are not excommunicated unless they willfully choose to do something that they know is gravely contrary to Church teaching, and will not do what is deemed necessary to express repentance for the wrong they have done. Unless the grandparents know they have done something that removes them from a state of grace and refuse to seek absolution, they would be able to receive the sacraments.
You raise a question, though: Under what circumstances is it a grave sin to baptize illicitly, if any? I would think a priest would better understand the gravity of dispensing the sacraments illicitly than a typical layperson. Still, I am only guessing about how it works for this particular case.
Speaking of, are these baptisms putative, or have the grandparents actually confessed to secretly baptizing the children? If they won’t say, it might be necessary to enlist the help of their pastor to find out one way or the other. Information pried from a 3-year-old probably is not sufficient to know for sure. If they have not done it yet, perhaps their pastor would clearly explain the law of the Church concerning their situation, in order to convince them to stick to licit evangelization methods.