Add missing contract generation error cases

Functions with dotted values or AnyValues in the return type
aren't yet supported for contract generation.

Related to PR 14894