What model of ESP32 board do you have? Not all versions support classic bluetooth.
I don't understand the AT use with the esp32, as the BluetoothSerial.h library should be what's used.
There is an Esp32 BluetoothSerial Library example ("SerialToSerialBTM") for a master configuration.
The HC05 can be configured as a master with AT commands.
I think it is more simple to leave the HC05 in its default mode as slave, and connect to it with the ESP32 as master.