Hi @VinhHo3010,
I've moved your question over to the developer group area, where it's more likely to find someone who may have encountered this before.
My guess is that this may be a "functioning as designed" type thing, but I'm not positive. When a course/enrollment is concluded, most things go into a read-only (or even inaccessible) state. This can cause some weirdness with what you're trying to do.
Are you able to give an overview of your goal? Maybe someone here will be able to suggest a better way o accomplish what you're trying to do. Since many courses won't even have an sis_id attached to them, you may want to take a different approach if you're trying to build a generic integration that will work across a variety of Canvas instances, but if you're trying to develop something custom for just one school that may not be a concern.
-Chris