Checkbox not showing as checked on UserProfile (even with checked=”checked”)

I guess the user-edit screen like tables only. Other check boxes I have are using the the standard table structure. So instead of just using input checkboxes, I’m inserting the check box in the element and the label in the element to follow the structure of the rest of the page. So now my code looks like this:

$courseResults = DwgFunctions::get_all_courses();
        $userWaivedModules = DwgFunctions::checkCourses('scorm_waived_courses',$user);
            foreach($courseResults as $course){
                $courseListing.= '<tr class="waived-modules"><th><input type="checkbox" name="waivedCourses[]" value="'.$course->getCourseId().'" '.DwgFunctions::dwg_checked($userWaivedModules,$course->getCourseId()).'/></th>';
                $courseListing.= '<td><label for="waivedCourses">'.$course->getTitle().'</label></td></tr>';
            }

This results in this:
enter image description here

Still not 100% sure why this works and the other doesn’t, but as long as it now works.