I mean it's not a bad thing to send in your condolences but if you haven't moved on and things ended on bad terms I hope you didn't send your condolences just hoping to get something in return.
I think that's all you should do for now and keep your distance. There's no ill intentions behind my message but you should move on even if you guys had history together and maybe one day y'all will reconcile as friends.

so like my ex boyfriend’s dad died, and we’re still in contact. he has a girlfriend. but when i heard the news i immediately called him in the spur of the moment. he didn’t pick up, ofcourse. i calmly texted him afterwards which he replied after a while. conversation stopped there. so when i told my friend abt it he was just really… idk how to put it. agitated? idk. he told me i should not contact him or whatever. i should move on (i still haven’t but thats not the point). ive known my ex boyfriend for almost 6 years now, we were very close friends before we got into a relationship. it ended pretty.. rough. that’s a story for another day but yeah. did i do the right thing?