Okay, it’s working almost the way it should. It’s only working if I have the Select field set to return “Values” and not “Labels”.
I can, however, get it to work with “Labels” if I change a line to
$values = get_field('classes', $post_id, false);
But then it only shows one result at a time. Like if multiple posts have a class value of “8”, it’s only displaying one.