Heltec Wifi Kit 32 V3 does not reboot with attached battery

Hello. I am using Heltec WiFi Kt 32 V3 with external I2c 4X20 display (with PCF8574). All works fine, when I am switching power from USB to LiPo battery. Switching the power from LiPo battery to USB (or 5V pin) crashes the code. I2C display shows garbage. Manually resetting help, the code starts to run again, but i would like to avoid that.

Can anoyone advise?

Can you better describe what you mean when you write “…when I am switching power from USB to LiPo battery…” ?
Do you mean when you remove 5V power and connect the battery?
Or is the battery permanently connected and therefore you simply remove the 5V power supply from the board and then the battery comes into operation?

I normally use the Wifi Kit 32 V3 and even switching from 5V to battery power (battery always connected to the card) and reconnecting the 5V does not cause what you described