he sounds really self centred.
He calls you when he needs to vent. He calls you to flirt. You're making him feel guilty...
It's all about him.
Someone who cares about you - thinks about you.
If I loved someone and someone they loved had just died, I would be there for them. If I couldn't be there physically, I would call them, let them know that I was thinking of them.
It's what you do for someone who matters to you.
He is not demonstrating that you matter to him.
I just can't believe you apologised to him. your grandfather has just died. You are upset. He doesn't see if you're ok, say sorry for your loss, be there for you to talk to, or do anything that demonstrates he cares you're in pain. He does however send you flirty messages
and when you tell him you're upset that he isn't showing he understands you're upset because you've lost someone - he's cross with you for making him feel bad, he doesn't appreciate being 'made' to feel guilty, he starts to ignore you...
... and you apologise!
You didn't owe him an apology. you really didn't.