But if your thesis passes, you can't graduate if you haven't passed the course. The paper is valid for one year.
To be on the safe side, you'd better pass all the courses before submitting your paper. This will ensure that you can get your degree. In case the thesis is overdue, you can only get a diploma, not a degree certificate. It would be a pity.
Of course, if you have confidence in this course, you can apply for a thesis and graduate six months in advance.
good luck