Here, have another glitch:
Titles/ranks are not capitalized unless used as a direct address or with the person’s name.
Having dinner with the emperor was a mistake.
Having dinner with Emperor Bob was a mistake.
I think it was a mistake to have dinner with you, Emperor Bob.