Your Serial Monitor shows you are using Arduino Mega . . . But your table shows Arduino Uno . . . not the same pins . . .
Also . . .
If you have uploaded code to the ESP01 you have overwritten the AT firmware, it will not communicate with the UNO or MEGA . . .
As a test I used your sketch, with Arduino MEGA, with ESP-01 AT Firmware at 9600bd (I flash my ESP-01s to 9600bd as they are much more reliable at low speed) - strangely it would not work connected to Serial1 (Pins 18, 19) - but worked perfectly fine on Serial2 (pins 16, 17).
So your sketch is fine if you change to Serial2 - but you need to clarify if you have AT firmware or have overwritten it with custom code.