The correct way to add a student to a class is to create a sale.
Sell Course to a Student
Add the student manually without a sale.