Wifinina seems to die after a while on Arduino Uno Wifi Rev2

Hello
I am using a Arduino Uno Wifi Rev2 to monitor a sensor, when the sensor value is over a specific threshold a message is posted to IFTTT server. Once the value returns below the threshold another message is posted. Posting only happens a once in a while (every 6 hours). For test purposes I trigger the posting manually a 2 or 3 times per minutes.

I am observing that the wifi.connectSSL is unable to connect once in a while, the Arduino is still running but the Wifi module does not seem to respond anymore. I also noticed that the Arduino stops responding to pings at that point.

The wifiConnectionCheck reports success, but the connectSSL eventually fails.

Any idea what could be causing this ?

Here is the postToIFTTT an wifiConnectionCheck routines:

void postToIFTTT(String jsondata)
{
  // Create a client, and initiate a connection
  WiFiSSLClient client;
  String HttpRequest;
  wifiConnectionCheck();

  DPRINTLN("Connecting to server... ");
    
  if (client.connectSSL(IFTTTServer.c_str(), httpsPort)) {
    DPRINTLN(F("Connected."));
    DPRINTLN(F("Posting to IFTT Event!"));

    HttpRequest = HttpReqHdr;
    HttpRequest+="Content-Type: application/json\r\n";
    HttpRequest+="Content-Length: " + String(jsondata.length()) + "\r\n\r\n";
    HttpRequest+=jsondata;
    DPRINTLN(HttpRequest);
    client.print(HttpRequest);
    
  }
  else
  {
    DPRINTLN(F("Failed to connect to server."));
    return;
  }
  
  // available() will return the number of characters
  // currently in the receive buffer.
  while (client.available()){
      Serial.write(client.read()); // read() gets the FIFO char
      DPRINTLN(F("POST value received"));
  }
  
  // connected() is a boolean return value - 1 if the 
  // connection is active, 0 if it's closed.
  if (client.connected()){
    client.stop(); // stop() closes a TCP connection.
    DPRINTLN(F("Closing Connection"));
  }
}

where wifiConnectionCheck() is :

void wifiConnectionCheck()
{
   if (WiFi.status() != WL_CONNECTED) {  
    Serial.print(F("Wifi Connection lost (Status="));
    Serial.print(WiFi.status());
    Serial.println(F(")"));
    WiFi.end();   
    WiFi.disconnect();
    WiFi.begin(mySSID, myPSK);
    Serial.println(F("Tried restart"));
    delay(5000);
  }
  else {
    DPRINT(F("Wifi Connected (Status="));
    DPRINT(WiFi.status());
    DPRINTLN(F(")"));
  }
}