@Makuna
Thanks Michael for the reply. I changed the way I handled with the bollow and now it is working fine:
uint8_t * mac;
mac = WiFi.BSSID(i);
Serial.printf(" , MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
Where i is the under question SSID number like :
int N= WiFi.scanNetworks();
for (int i = 0; i < N; i++)
{
mac = WiFi.BSSID(i);
Serial.printf(" , MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
}