I found in issue when you backup a course and then restore it as a different name. When you do that the "Other course completion" restriction still exists, but the course that was restricted to is lost. It is replaced with {$a} when looking at the course, and when editing the restriction it appears to have not been set yet. The only fix in this case is to edit all of the restrictions in the course and set them to the correct course again.
I found in issue when you backup a course and then restore it as a different name. When you do that the "Other course completion" restriction still exists, but the course that was restricted to is lost. It is replaced with {$a} when looking at the course, and when editing the restriction it appears to have not been set yet. The only fix in this case is to edit all of the restrictions in the course and set them to the correct course again.