Actually PreUserRegistrationError looks like a class to me since it is instantiated using the new keyword. And this class takes in two parameters which are both strings, the first parameter is the error shown in the logs (which worked for me as expected) and the second parameter is the error displayed to the user (which did not work as expected and returned above message i posted).
I hope auth0 checks what could be wrong with their hooks. Otherwise i moved on from this and decided not to use the hooks.