You should instrument (using console.log statements) the user creation script for your custom database and try to obtain additional information about at which step if any it is failing. With custom databases the possible errors that can be triggered will be directly related to the implementation of the scripts so just from that error message it will be difficult to say the root cause.
If after adding instrumentation and using Webtask Real-time Logs extension to see the output you still do not have relevant information you may need to provide additional data about the custom script implementation itself. Also note that the signup of a database user may trigger specific hooks so ensure that if you have hooks, they are also working as expected.