Fix error message on invalid field names for a struct variant

Fixes #19922.
fixup! Fix error message on invalid field names for a struct variant