I think I might find a bug in cohort sync enrollment type. When I add cohort sync enrollment to a course with a role of student, I can assign the student role for all of the cohort members ( I accidentally chose student rather than a teacher) . However, when I go to managing enrollment methods of the course and hit the edit gear button for the cohort sync enrollment and change the "assign role" from student to teacher, the cohort members are added to teacher role and kept the previously added student role. I cannot manually delete student role since the role was added by a cohort sync enrollment method.
Only workaround that I can find so far is to delete cohort sync enrollment and add new instance for the same cohort with the desired role. But if the cohort members are done some activities in the course, this can be problematic. So I hope you have better solution for the situation.