Article before nouns in the appositive phrase?

Interesting question.

I believe that in most cases (including both your cases) either is possible, and there is no significant difference in meaning, but there is a subtle difference in connotation.

If you omit the article, you are effectively using the role as a title, rather than a description.

Looking on the iWeb corpus, ", CEO of" has 54341 instances, while ", the CEO of" has 6775; and ", president of" has 98275, against 14398 for ", the president of".

Contrast that with something that is rarely used as a title: ", inventor of" has 1668, while ", the inventor of" has 1916.