iPhone shut off when plugged in
I am using iPhone XS (iOS 16.0). Sometimes when I plug my phone into charging cable, the phone shuts off itself(if I am not using it). When this happens, whenever I plug my earphones in, the phone shuts off instantly and cannot reopen until I unplug the earphones.