History is full of ranks and titles. With those ranks came specific honorifics (tribute) which people gave to denote their respect to that rank.
When writing historical fiction, I think it’s important to keep titles accurate. Why would anyone ever call a king “my lord”? Is there a circumstance (yes) or would it be derogatory (also possibly yes!)? What country are you writing in and how did they handle/approach/approve nobility? There is a world (no pun intended) between how the British handled nobility before & after William (much less when you address England, Scotland, the Welsh & the Irish… There is a gap between how the Italian peninsula handled nobility and the French aristocracy.
In fantasy, there is a lot more leeway. One of the difficulties that even gets discussed in The Three Musketeers is the struggle of keeping one’s titles and appropriate use of those titles polite. (I remember reading it in high school and giggling… and then obsessively looking up various titles and crests of continental nobility)
With the advent/growth of the digital book, I have found that custom systems become harder to handle however. When I was first reading high fantasy, many books had a page (or several) at the front or the back with a glossary of terms or a hierarchy tree laid out. Unfortunately, ebooks don’t handle that well (they don’t handle footnotes well in my opinion). I suspect this will be fixed eventually. Someone will come up with a better method.
It’s really about consistency. Internal inconsistency is probably my one pet-peeve in novels. “why is this dude called your grace sometimes and my lord other times? I can’t see a pattern! WHHHHYYYY!”