Fixed #23721 -- check_related_objects without calling __iter__

Refs #14334