What version of Moodle are you on? When we upgraded to Moodle 3.4 the problem seemed to fix itself. You may also find updating your Attendance fixes the issue.
Attendance (plugin)
Attendance & Gradebook don't match
This discussion has been locked so you can no longer reply to it.