Auth0 Pre-User Registration hook shows different message on universal signup page

I get the message “WE’RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP.” even after setting up the message correctly in my hook. Below is what i am returning from one of my conditions.

return cb(new PreUserRegistrationError(‘Denied user registration in Pre User Registration Hook’, ‘Email is not allowed’));

I expect the message ‘Email is not allowed to show on the signup page’. However the logs show that everything is working.