Fix error message for misuse of #:methods

Closes PR 14069