Inaccuracy reading using SCT013-50A/1V and esp32 for energy monitoring

Read again my first reply to you. Whichever range (Atten = 0 etc) you are using, 1.65 V from GND to the red wire is not the centre of the measuring range. This is the first problem you must correct.

When you have corrected the voltage so that the red wire is at about 1.3 V, can you temporarily connect red and white wires together, and report the number you get by putting this line somewhere inside loop

Serial.print("Pin 34 = ");Serial.println(analogRead(34));

It should be a number near to 1590 and in theory, it should be the same every time (every 1 second), but in the real world you can expect it to vary maybe 20 either side.

If it varies a lot more than this, the first thing you should do is make all those connecting wires as short as possible. Having long loops of wire is not good.
What are you using to power the ESP32? If there is electrical noise on that supply, then that will be appearing on your output.