Unfortunately, the timeout value for the login page cannot be changed, and the error you are seeing is due to your custom database script exceeding the time limit.
Because the timeout value for a custom database script cannot be configured, the requests in your script must stay within the timeout value.
In this situation, I suggest checking your custom database scripts, specifically the Get User and Login scripts. Then, use the Auth0 Real-time Webtask Logs Extension to view those console.log outputs and exceptions.