Looking at the addadmin script, creating my own script withÂ
$db->putPermissionLevel($db->newPermissionLevel(user_id=>"admin", permission=>"20"));
exit;
and using wwsh to apply it on the admin course (see https://webwork.maa.org/moodle/mod/forum/discuss.php?d=6642#p17935) did the trick and resolved the issue -- yeah!
Not sure why the permission level changed in the first place, though.