In this scenario, you chose a topic that you had researched and written about for a previous course. To complete the paper, you used parts of the paper you had written previously.
Although students may believe that there is nothing wrong with this, it is in fact considered to be self-plagiarism, a breach of academic integrity. It does not matter whether the re-used work is submitted for different courses, in different years, for different programs, even in different schools, it is still considered a breach.
According to Sheridan’s Academic Integrity Policy (2016), when you submit "substantial portions of the same work to more than one course without consulting the faculty members who teach these courses" (p. 4), this is considered to be a form of cheating.