Fix prefix exception message (Closes #23364)