See the updated Note [Detecting incomplete record selectors].
Fixes #24824 (closed) and #24891 (closed).