PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR On Certain Hour

I have a problem about connecting to MySQL. After 8 PM (My local time), the connection is lost. So I modified my code, whenever mysql throw PROTOCOL_CONNECTION_LOST, it will try to reconnect to the mysql. The error for PROTOCOL_CONNECTION_LOST is gone, but it give new error code PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR when trying to connect to the server.
This is my code to create connection to MySQL.

const dbConn = mysql.createConnection({
    host        : 'localhost',
    user        : 'xxxx',
    password    : 'xxxx',
    database    : 'test'
});

function handleDisconnect() {

  dbConn.connect(function(err, connection) {             
    if(err) {                                     
      console.log('error when connecting to db:', err);
      setTimeout(handleDisconnect, 2000); 
    }       
  });                                     
   
  dbConn.on('error', function(err) {
    console.log('db error', err);
    if(err.code === 'PROTOCOL_CONNECTION_LOST') { 
      handleDisconnect();                         
    } else {                                     
      throw(err)                       
    }
  });
}

handleDisconnect();
module.exports = dbConn;

This is my error stack

0|index    | error when connecting to db: Error: Cannot enqueue Handshake after fatal error.
0|index    |     at Protocol._validateEnqueue (/home/mydev/SOBATku/node_modules/mysql/lib/protocol/Protocol.js:212:16)
0|index    |     at Protocol._enqueue (/home/mydev/SOBATku/node_modules/mysql/lib/protocol/Protocol.js:138:13)
0|index    |     at Protocol.handshake (/home/mydev/SOBATku/node_modules/mysql/lib/protocol/Protocol.js:51:23)
0|index    |     at Connection.connect (/home/mydev/SOBATku/node_modules/mysql/lib/Connection.js:116:18)
0|index    |     at handleDisconnect (/home/mydev/SOBATku/config/db.config.js:34:10)
0|index    |     at Connection.<anonymous> (/home/mydev/SOBATku/config/db.config.js:45:7)
0|index    |     at Connection.emit (node:events:390:28)
0|index    |     at Connection._handleProtocolError (/home/mydev/SOBATku/node_modules/mysql/lib/Connection.js:423:8)
0|index    |     at Protocol.emit (node:events:390:28)
0|index    |     at Protocol._delegateError (/home/mydev/SOBATku/node_modules/mysql/lib/protocol/Protocol.js:398:10) {
0|index    |   code: 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR',
0|index    |   fatal: false
0|index    | }

It can reconnect when I do some command like pm2 logs or other command with pm2 (I use pm2 for the node run command). Planning to use cron function to restart my server every 8PM, but if it can solved without restart the server, it will be very helpful. Thank you.