Could you call it "Serial2", because that is what everyone else is using.
Perhaps just a Serial2.begin( 9600) is enough, without the two lines with "HardwareSerial". There has been many improvements for the ESP32 and ESP8266 in the last years.
Can measure the TX and RX of the module when nothing is connected to it. They are idle high. Are they 5V or 3.3V ?
The ESP32 is not 5V tolerant.
thanks a lot for your help! I measured the voltages and doublechecked everything and still couldn't find my mistake - until I swapped the TX and RX wires by mistake, which has actually been my mistake.
I connected the TX from the board to the TX to the ESP32, which obviously doesn't make any sense.
So now I connected TX to Rx and vice versa and now everything works perfectly. Sorry for that!
I'm glad you found the problem. Such things happens to all of us.
Can you still try to make it simpler by just using "Serial2" ? The ESP32 code has been improved and is also more compatible with the Arduino code than a few years ago.