I think you have a typo in the second code example:
let students = useDbDatum(`classes/${classUid}/students`);
let uids = Object.keys(students || {});
let paths = studentIds.map(id => `students/${id}/name`);
studentIds on line 3 should probably be uids