You sound like a good dad Lostdad - that is how relationships are formed and maintained regarding you and your DS but if there were real reasons why your DS could not form a relationship with gran then you would understand surley and not force at all costs?
It sounds like the relationship the Op's ex has with his DD is an issue for some reason. I agree OP the sporadic contact is an issue here and maybe one reason - I don't have advice on how to solve that as you can't make him see her regularly and when he does have her, built the relationship. You can't build a relationship between two other people even if you wanted to, you can encourage it which is what you have been doing.
The thing I disagree with lostdad on is that is is not in the child best interest to have a relationship with her dad per se, it is in the child's best interest to have a good relationship with her dad and at the moment that isn't there - research clearly states that bad relationships can damange children. That is not to say it is to be abandoned at this stage but needs to be looked at which is what the OP is asking for help on, to just pretend there is no problem and force contact will not solve the issue. Again I'm being unhelpful really as this doesn't give you a solution OP.
I agree with those who have said if thier DC suddenly didn't want to go to school a good parent would ask why - not just force them. This happened to my DS, I found the root cause, it was solved and he was back to enjoying school. He was involved in the whole process, he knew he was able to express he was upset/frightened as it turned out, children have to be able to feel confident they can communicate thieir distress, so they don't grow up overly responsible and not abused by others. At your DD's age they are in the process of developing that emotional understanding, if it is not developed properly then she will have problems later in life.
So I guess what I am offering as advice is to try and find out why she does not want to go and if there is something that can be done and a regular pattern of contact is always a positive as DC need routine and knowing where they are.