From my own experience, my Father was very ill and died the day after my nephew's 21st birthday, what is important is to demonstrate care for the bereaved person, rather than to wish them a happiness which might seem inappropriate in the moment.
To wish someone a happy day at the funeral of a close family member, as you clearly understand, has potential to be inappropriate, though the degree of inappropriateness would to some extent depend upon your existing relationship with Bob and the delivery of the wish.
Something else which may be relevant is to think about what age Bob is. Is the birthday a significant one? Is he being 21, 30, 42? Any birthday which is in someway significant in your culture, or if Bob is still quite young, will seem like a bigger deal to be missing than a random birthday for a middle-aged person (I say this as a 53 year old, we're over the excitement of birthdays for the most part)
The fact that you understand that and don't want to say the wrong thing shows that you do care for Bob, so it would be appropriate to find a form of words which recognises the fact of his birthday without wishing him present joy.
This lets Bob know that he has not been forgotten but also understand the respect that you are showing to him and his Grandmother.
The words you use will very much depend on your own personality and your relationship with Bob, but after you have generally expressed condolences, something along the lines of this would cover those points.
...and on top of how much we're all going to miss her, I wanted to say how sorry I was about the timing of everything and to let you know that I still remember that it's your day too.
It is is a significant birthday that he's missing you could follow up with planning to meet up at some later stage (even if you wouldn't generally do that for his birthday you might want to this year as part of reinforcing family bonds and recognition of the horrible timing - but only if you actually would enjoy meeting up and it isn't wildly impractical due to travel times or something), or you could make a point of sending him a nice letter or a small gift in the following days.
In the end only you can judge what would work in the relationship between you and Bob, but remember you can recognise his birthday without wishing it to be 'happy'.