Can't initialize ESP8266-01 on Arduino Mega

I'm using the WifiEsp.h library and the webclient example it has, found here : GitHub - bportaluri/WiFiEsp: Arduino WiFi library for ESP8266 modules

So i have an arduino Uno and a Mega. The Mega does some other stuff but im gona use it later as a server. For now i want to test everything works from base to the top. So i put the same program on both of Uno and Mega with only differences the pins for the Tx Rx of the ESP.

I have configured the esp's to work on 9600 baud rate through at commands and flashed to version 1.1.1.

Now this is so weird for me ... On the Uno the ESP works like a charm! It connects right away to my network and prints the info as the example shows. I then tried with Mega and its own ESP... No luck.. I just won't initialize. I then used the same ESP as the one i had on Uno that worked (in case i got a faulty chip).
Yet again , it does not initialize. Showed me the error that no Wifi Shield found... I change the connection, the Rx Tx so i go into the config mode with the AT commands and i can see it!!! I send AT commands and it works... I change back the cables and it just won't initialize...

i have a voltage divider for the arduino pin cause pins give 0 or 5 V . And i have external power supply 3.3V for the ESPs as arduino doesn't have anough mA to supply.

I tried different pins 24-25 , 17-18 , 18-19(saw there is a grouping in some cases) and some other ones. I then borrowed another Mega arduino to test that my arduino isn't faulty. I had the exact same problem.

Can someone bless me with what the hell am i doing wrong ?

the example expects the esp8266 on hardware Serial1

#ifndef HAVE_HWSERIAL1 <-- this is true for Mega so SoftwareSerial is not used
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

Indeed that's where i have it connected! As i said i only changed the number on code of the pins, based on where i put the Tx and Rx of the ESP.

sorry HAVE_HWSERIAL1 is true so #ifndef skips the SoftwareSerial part.
wire the esp8266 to RX1 and TX1 of the Mega. TX of the esp8266 to RX1 and RX of the esp8266 to TX1

The wiring is correct. I wrote that if i move the setup exactly as it is from the Mega to Uno it will work !
with same code.

I did not understand the HAVE_HWSERIAL1 being always true on Mega, and if im supposed to change the code specially for the arduino Mega use. Could you please explain further ?

EDIT: OH i see what you mean ! Let me run some tests and report back.

Ok it seems i got it to work! I think the problem was at my voltage divider. The resistors are quite old and i should probably get some new ones. Welp.. Thanks a lot for the input i surely learned something new about arduino. The wires were in correct place in my previous tests but sometimes i think my ESPs bug and i need to reset power few times.