Lady Gabriella's father and Prince William's grandmother were first cousins, so they're second cousins once removed. And her parents were able to attend. So I think William could have held off for an hour or two (especially as the death occurred on Sunday, and he could have withdrawn in a more orderly fashion on Monday rather than considerably more noticeably just an hour before the start)
He would also have known well in advance that there would be a general invitation to most/all of his family, especially all descendants of Prince Phillip (first cousin of King Constantine). So I think if he were disinclined to attend events where Andrew would turn up, he would have declined the invitation. He certainly would not be so rude as to agree to do a reading, then cry off on one hour's notice for that reason.
Which is why people keep coming back to the only acceptable reasons, which are also so urgent that they cannot wait a couple of hours. So illness (D&V, something contagious or something which means he's lost his voice and feels like utter crap), or something up with one of the DC that cannot be handled by school or household staff for an hour (trip to A&E, need for parental consent for a procedure - maybe pinning a bone or something else that might require an anaesthetic, like suspected appendicitis)