Call raise-argument-error correctly.
Add testcase.

Closes PR 12812.